This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: very poor cygwin scp performance in some situations

On Mar 28 11:43, Steven Hartland wrote:
> ----- Original Message ----- 
> From: "Corinna Vinschen" 
> >On Mar 27 16:39, Steven Hartland wrote:
> >>I've done quite a bit of digging and not found any real answers
> >>on why cygwin's scp performance is so poor.
> >
> >Cygwin is just emulating POSIX by calling Windows functions.  It's not
> >an operating system which runs natively on the machine, so what do
> >you expect?  If you're unhappy with scp's performance you can try
> >using:
> >
> >- sftp
> >
> >- tar over ssh:
> >
> >   tar cf - dir-to-copy | ssh remotemachine 'cd targetdir && tar xf -'
> >
> >-
> Sorry to sound rude but did you even look at the figures I posted?

Yeah, I'm just slightly annoyed about the "Cygwin is slow" routine on
this mailing list.

However, the performance of ssh/scp is not a Cygwin problem per se.
Note that the poor performance of ssh/scp is a well-known fact, which
has been discussed pretty often on the ssh developers list, and which
has different impact on different OSes.  The above hpn patch was
supposed to tackle exactly this problem.  It's not integrated into
mainline so far, because security is of a bigger concern than speed for
the OpenSSH developer team, which should be immediately understandable.

I made some tests locally and my default numbers (118 Meg file) are

  From Linux to Cygwin, started on Linux:  9.1MB/s
  From Linux to Cygwin, started on Cygwin: 1.2MB/s
It turns out that three factors limit the speed on the client side:

- The worst of all is ssh itself.  When reading blocks from the network,
  it uses an 8K buffer.  Whatever you try with setting different socket
  buffer sizes or disabling the Nagle algorithm, nothing has any
  interesting impact if not ssh's own buffer is raised in size.  By just
  setting the buffer to 64K (in the ssh source file clientloop.c,
  function client_process_net_input, line 575), the above copy started on
  Cygwin suddenly races along with 4.2MB/s.

- The default WinSock send/recv buffer size is apparently 8K.  This is a
  quite small buffer for bulk data transfer.  Raising this buffer to 64K
  (setsockopt's SOL_SOCKET/SO_RCVBUF option), too, results in a
  throughput of 5.9MB/s.

  Note that the performance suffers again, if the socket buffer is
  smaller than the application buffer.

- Disabling the Nagle algorithm (setsockopt's IPPROTO_TCP/TCP_NODELAY
  option) doesn't really have a lot of impact, but it's slightly
  noticable.  The throughput goes up to 6.1MB/s.

And no, I won't release an OpenSSH package which differs from the
vanilla sources, unless it's really really necessary to get it working
on Cygwin.  If the performance is a problem for you, build your own
package.  You should have enough details now to get this done.


Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]