cygwin performance problem

Damien Miller djm at
Tue Apr 18 22:47:10 EST 2006

On Tue, 4 Apr 2006, Corinna Vinschen wrote:

> Not sure if it's ok to discuss this here. However, we have some
> performance problems on Cygwin with the vanilla version of OpenSSH.  The
> main problem is the size of the read buffers in the client loop, resp.
> client_process_net_input/client_process_input.  The buffer size is a
> fixed 8K.  For some reason this degrades performance on Windows
> enormously

Is it necessary to adjust both these buffers? Or does increasing only
the network buffer in client_process_net_input() help?

> By raising the aforementioned buffers in clientloop.c from 8192 to, say,
> 87380 (default tcp recv buffer size), the latter copy is way faster:

Have you tried smaller numbers than 87380? It isn't much effort to
crank these buffers up if smaller reads have a performance penalty
on Windows, but I'd prefer to make changes based on some measurements.
Could you try a range of buffer sizes from 8192 up (doubling perhaps)
and see if there is a sweet spot of size vs. performance?

> Is it ok to do that?  Is there any problem you would expect from raising
> the buffer sizes?  Is there any reason to keep the buffers at 8K in the
> vanilla version or would it be ok to raise the buffers to a somewhat
> bigger value like 64K or the aforementioned 87380 bytes?

I think raising these sizes is safe: all the file descriptors are in
non-blocking state so increasing them will only read more data if it
is already available on the kernel side at the expense of some stack


More information about the openssh-unix-dev mailing list