From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mailout.easymail.ca (mailout.easymail.ca [64.68.200.34]) by sourceware.org (Postfix) with ESMTPS id 240F9385782E for ; Wed, 25 Aug 2021 17:31:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 240F9385782E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=islandmacguy.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=islandmacguy.com Received: from localhost (localhost [127.0.0.1]) by mailout.easymail.ca (Postfix) with ESMTP id B247910D9EF; Wed, 25 Aug 2021 17:31:57 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at emo02-pco.easydns.vpn Received: from mailout.easymail.ca ([127.0.0.1]) by localhost (emo02-pco.easydns.vpn [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id SSOnFquzObu0; Wed, 25 Aug 2021 17:31:53 +0000 (UTC) Received: from tringa.house.org (S0106bcee7b974edc.gv.shawcable.net [24.108.53.141]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mailout.easymail.ca (Postfix) with ESMTPSA id E391910D9F3; Wed, 25 Aug 2021 17:31:52 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\)) Subject: Re: cygrunsrv + sshd + rsync = 20 times too slow -- throttled? From: Chris Roehrig In-Reply-To: <20210825201845.07b6400b79dc5558a7761efe@nifty.ne.jp> Date: Wed, 25 Aug 2021 10:31:52 -0700 Cc: cygwin@cygwin.com Content-Transfer-Encoding: quoted-printable Message-Id: <22EDD785-DC5B-48EA-85D0-20D0E6F5D076@islandmacguy.com> References: <41A583E1-C8E7-42AB-9F24-EEC33A41EC60@house.org> <20210825201845.07b6400b79dc5558a7761efe@nifty.ne.jp> To: Takashi Yano X-Mailer: Apple Mail (2.1499) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: cygwin@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Aug 2021 17:32:08 -0000 The FILE_FLAG_OVERLAPPED avenue looks promising. I get exactly the = same results as you using 'scp': 4MB/s in either direction (with = either remote endpoint.) I guess the next step is to install a build environment and build rsync = and sshd ... On Wed Aug 25 2021, at 4:18 AM, Takashi Yano via Cygwin = wrote: > On Tue, 24 Aug 2021 12:49:52 -0700 > Chris Roehrig wrote: >> I have a network of Windows, Linux and Mac machines and I use rsync = to synchronize various directories between them. >>=20 >> I'm trying to figure out why my rsync transfers are so slow (<4 MB/s) = only when the remote endpoint is Cygwin rsync over sshd (with both a = Linux or Cygwin rsync client). In all other scenarios, I get the full = 100MB/s as expected from gigabit ethernet. This has been an ongoing = problem for me for a couple of years over several Windows and Cygwin = versions, and I'd like to try to fix it. =20 >>=20 >> If I run rsync --daemon --no-detach under mintty in the foreground on = the remote Windows endpoint, I get the full 100 MB/s transfers, so it = seems like it has something to do with rsync.exe running in the = background under the cygrunsrv+sshd service (which was installed = normally using ssh-host-config). >>=20 >> If I do: >> pv /dev/zero | ssh $WINHOST "cat > /dev/null" >> or even >> pv /dev/urandom | ssh $WINHOST md5sum >> I also get the full 100 MB/s transfers, so it doesn't look like sshd = itself is being throttled by bandwidth or CPU. >>=20 >> The machines have less than 15% CPU utilization while transferring, = with each of the 4 cores less than 30%, so it doesn't look to be CPU = issue. >> In Task Manager, sshd.exe and rsync.exe seem to be running normally = using only few percent CPU, and show Power Throttling=3DDisabled, = Priority=3DNormal. Setting their Priority to High doesn't seem to = change things. >>=20 >> Looking in Resource Monitor on the remote endpoint, the network usage = is pretty much a flat horizontal line at about 18 Mbps (2.5 MB/s), so it = sure looks to me as if rsync is somehow being bandwidth-throttled=08 = when run in the background under cygsshd. >>=20 >> It's almost as if rsync has an implicit --bwlimit override when it is = run from cygrunsrv+sshd (I've tried --bwlimit=3D0 on the client which = makes no difference). >>=20 >>=20 >> Any ideas? Not sure where to go from here.=20 >=20 > In cygwin, just scp is very slow. >=20 > The transfer speed in my environment is as follows. > The tests were done with 100MB of test.dat file. >=20 > (1-1) =46rom cygwin-PC, > [yano@cygwin-PC ~]$ scp test.dat yano@linux-server:. > yano@linux-server's password: > test.dat 100% 100MB 4.0MB/s = 00:24 > [yano@cygwin-PC ~]$ scp yano@linux-server:test.dat . > yano@linux-server's password: > test.dat 100% 100MB 8.0MB/s = 00:12 >=20 > (1-2) =46rom linux-server, > yano@linux-server:~$ scp yano@cygwin-PC:test.dat . > yano@cygwin-PC's password: > test.dat 100% 100MB 4.0MB/s = 00:24 > yano@linux-server:~$ scp test.dat yano@cygwin-PC:. > yano@cygwin-PC's password: > test.dat 100% 100MB 4.1MB/s = 00:24 >=20 >=20 > I looked into this problem, and noticed that this is caused > by cygwin pipe implementation. Pipe in cygwin is configured > with FILE_FLAG_OVERLAPPED. >=20 > If the pipe is configured without FILE_FLAG_OVERLAPPED, > the transfer speed is much improved as follows. >=20 >=20 > (2-1) =46rom cygwin-PC, > [yano@cygwin-PC ~]$ scp test.dat yano@linux-server:. > yano@linux-server's password: > test.dat 100% 100MB 85.5MB/s = 00:01 > [yano@cygwin-PC ~]$ scp yano@linux-server:test.dat . > yano@linux-server's password: > test.dat 100% 100MB 69.7MB/s = 00:01 >=20 > (2-2) =46rom linux-server, > yano@linux-server:~$ scp yano@cygwin-PC:test.dat . > yano@cygwin-PC's password: > test.dat 100% 100MB 80.1MB/s = 00:01 > yano@linux-server:~$ scp test.dat yano@cygwin-PC:. > yano@cygwin-PC's password: > test.dat 100% 100MB 57.7MB/s = 00:01 >=20 > I am not sure why this happens and how to fix this. > Any idea? >=20 > --=20 > Takashi Yano >=20 > --=20 > Problem reports: https://cygwin.com/problems.html > FAQ: https://cygwin.com/faq/ > Documentation: https://cygwin.com/docs.html > Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple