delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2021/08/25/17:34:40

X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 615403857C5F
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1629927279;
bh=l3msTPyaszU/F7EKMnKvLYrmhQh127DGs3KYT2UD6Kk=;
h=Date:To:Subject:In-Reply-To:References:List-Id:List-Unsubscribe:
List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:
From;
b=Ie7scsRjkGyZ6FF+p2fKSGnyBYn6Z6ZGrXgdOBSTXSsqOrVlUqsmIPivhVcuXvNDW
+W0kI2q4DnMCOcHurU2w9GkGBe0EFJoTw9hDCmlbva4Rh8kSfv9yjSj4gYNG6RKGby
TZLCpl3/vei+daWH2T3yDN1AmLkyjegmFply4WL8=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 371393858001
DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-04.nifty.com 17PLTSCN013703
X-Nifty-SrcIP: [110.4.221.123]
Date: Thu, 26 Aug 2021 06:29:34 +0900
To: cygwin AT cygwin DOT com
Subject: Re: cygrunsrv + sshd + rsync = 20 times too slow -- throttled?
Message-Id: <20210826062934.54f2f2216021c095bb7ba13b@nifty.ne.jp>
In-Reply-To: <f8106fe7-a2b8-d106-3061-4d888124f4b0@cornell.edu>
References: <41A583E1-C8E7-42AB-9F24-EEC33A41EC60 AT house DOT org>
<20210825201845 DOT 07b6400b79dc5558a7761efe AT nifty DOT ne DOT jp>
<f8106fe7-a2b8-d106-3061-4d888124f4b0 AT cornell DOT edu>
X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-mingw32)
Mime-Version: 1.0
X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, DKIM_SIGNED,
DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_NONE,
SPF_HELO_NONE, SPF_PASS, TXREP 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 AT cygwin DOT com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Takashi Yano via Cygwin <cygwin AT cygwin DOT com>
Reply-To: Takashi Yano <takashi DOT yano AT nifty DOT ne DOT jp>
Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com>

On Wed, 25 Aug 2021 13:52:19 -0400
Ken Brown wrote:
> On 8/25/2021 7: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.
> >>
> >> 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.
> >>
> >> 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).
> >>
> >> 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.
> >>
> >> 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=Disabled, Priority=Normal.   Setting their Priority to High doesn't seem to change things.
> >>
> >> 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 when run in the background under cygsshd.
> >>
> >> It's almost as if rsync has an implicit --bwlimit override when it is run from cygrunsrv+sshd (I've tried --bwlimit=0 on the client which makes no difference).
> >>
> >>
> >> Any ideas?    Not sure where to go from here.
> > 
> > In cygwin, just scp is very slow.
> > 
> > The transfer speed in my environment is as follows.
> > The tests were done with 100MB of test.dat file.
> > 
> > (1-1) From cygwin-PC,
> > [yano AT cygwin-PC ~]$ scp test.dat yano AT linux-server:.
> > yano AT linux-server's password:
> > test.dat                                      100%  100MB   4.0MB/s   00:24
> > [yano AT cygwin-PC ~]$ scp yano AT linux-server:test.dat .
> > yano AT linux-server's password:
> > test.dat                                      100%  100MB   8.0MB/s   00:12
> > 
> > (1-2) From linux-server,
> > yano AT linux-server:~$ scp yano AT cygwin-PC:test.dat .
> > yano AT cygwin-PC's password:
> > test.dat                                      100%  100MB   4.0MB/s   00:24
> > yano AT linux-server:~$ scp test.dat yano AT cygwin-PC:.
> > yano AT cygwin-PC's password:
> > test.dat                                      100%  100MB   4.1MB/s   00:24
> > 
> > 
> > I looked into this problem, and noticed that this is caused
> > by cygwin pipe implementation. Pipe in cygwin is configured
> > with FILE_FLAG_OVERLAPPED.
> > 
> > If the pipe is configured without FILE_FLAG_OVERLAPPED,
> > the transfer speed is much improved as follows.
> > 
> > 
> > (2-1) From cygwin-PC,
> > [yano AT cygwin-PC ~]$ scp test.dat yano AT linux-server:.
> > yano AT linux-server's password:
> > test.dat                                      100%  100MB  85.5MB/s   00:01
> > [yano AT cygwin-PC ~]$ scp yano AT linux-server:test.dat .
> > yano AT linux-server's password:
> > test.dat                                      100%  100MB  69.7MB/s   00:01
> > 
> > (2-2) From linux-server,
> > yano AT linux-server:~$ scp yano AT cygwin-PC:test.dat .
> > yano AT cygwin-PC's password:
> > test.dat                                      100%  100MB  80.1MB/s   00:01
> > yano AT linux-server:~$ scp test.dat yano AT cygwin-PC:.
> > yano AT cygwin-PC's password:
> > test.dat                                      100%  100MB  57.7MB/s   00:01
> > 
> > I am not sure why this happens and how to fix this.
> 
> A couple years ago I had an idea for changing the pipe implementation to avoid 
> overlapped I/O:
> 
>    https://cygwin.com/pipermail/cygwin-patches/2019q2/009393.html
>    https://cygwin.com/pipermail/cygwin-patches/2019q2/009423.html
> 
> I never followed up on it.  But if you think it might help with this problem, I 
> could dust it off and try to finish it.

Interesting.

It will be also helpfull for:
https://cygwin.com/pipermail/cygwin/2021-March/247987.html
which seems to be the same issue with
https://stackoverflow.com/questions/10385424/good-alternatives-to-cygwin-cygwin-doesnt-support-natively-support-win32-app

However, I wonder why scp dislikes overlapped I/O.

-- 
Takashi Yano <takashi DOT yano AT nifty DOT ne DOT jp>

-- 
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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019