Read buffer size in clientloop.c

Corinna Vinschen vinschen at
Tue Jul 7 20:57:16 EST 2009


when trying to optimize socket transfer rates under Cygwin, it turned
out that the underlying WinSock implementation is surprisingly sensitive
to buffer sizes.  The latest Cygwin from CVS is now setting the socket
receive/send buffers (SO_RCVBUF/SO_SNDBUF) to 64K, rather than keeping
them at their default values of 8K which thwarts data transfers a lot.

While testing I still had the problem that for some reason the ssh read
transfer rates were only a third up to a half of the write transfer
rates.  It turned out that the culprit was ssh itself.  In clientloop.c,
it defines read buffers of the size 8K.  Setting them to 64K under
Cygwin raises the read transfer rates comparable to the write rates.

It occured to me that we talked about this already 3 years ago in a
thread about HPN-SSH, just the performance numbers were different:

So the question I have is again this:

Would it be ok to raise the buffers in client_process_net_input() and
client_process_input() to 64K, maybe only on Cygwin?  Or to make the
buffer sizes a configurable option?


Corinna Vinschen
Cygwin Project Co-Leader
Red Hat

More information about the openssh-unix-dev mailing list