Darren Tucker | 7 Jul 2009 13:53
Picon
Picon

Re: Read buffer size in clientloop.c

On Tue, Jul 07, 2009 at 12:57:16PM +0200, Corinna Vinschen wrote:
> 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:
> http://marc.info/?l=openssh-unix-dev&m=114414372902485&w=2
> 
> 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?

If there's a measureable performance gain (which it sounds like there is)
then I personally have no objection to making it a compile time option.
Damien?  Maybe something like this?

Index: clientloop.c
===================================================================
RCS file: /home/dtucker/openssh/cvs/openssh/clientloop.c,v
(Continue reading)

Corinna Vinschen | 10 Jul 2009 11:33
Picon
Favicon

Re: Read buffer size in clientloop.c

On Jul  7 21:53, Darren Tucker wrote:
> On Tue, Jul 07, 2009 at 12:57:16PM +0200, Corinna Vinschen wrote:
> > 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?
> 
> If there's a measureable performance gain (which it sounds like there is)
> then I personally have no objection to making it a compile time option.
> Damien?  Maybe something like this?

I tested this patch and it works fine for Cygwin.

Thanks,
Corinna

--

-- 
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat
Corinna Vinschen | 14 Jul 2009 11:39
Picon
Favicon

Re: Read buffer size in clientloop.c

Hi Darren,

On Jul 10 11:33, Corinna Vinschen wrote:
> On Jul  7 21:53, Darren Tucker wrote:
> > On Tue, Jul 07, 2009 at 12:57:16PM +0200, Corinna Vinschen wrote:
> > > 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?
> > 
> > If there's a measureable performance gain (which it sounds like there is)
> > then I personally have no objection to making it a compile time option.
> > Damien?  Maybe something like this?
> 
> I tested this patch and it works fine for Cygwin.

Will this patch be checked in at one point?

Thanks,
Corinna

--

-- 
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat
Darren Tucker | 28 Aug 2009 03:22
Picon
Picon

Re: Read buffer size in clientloop.c

Corinna Vinschen wrote:
> Hi Darren,
> 
> On Jul 10 11:33, Corinna Vinschen wrote:
>> On Jul  7 21:53, Darren Tucker wrote:
>>> On Tue, Jul 07, 2009 at 12:57:16PM +0200, Corinna Vinschen wrote:
>>>> 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?
>>> If there's a measureable performance gain (which it sounds like there is)
>>> then I personally have no objection to making it a compile time option.
>>> Damien?  Maybe something like this?
>> I tested this patch and it works fine for Cygwin.
> 
> Will this patch be checked in at one point?

Yes, it was just committed and will be in 5.3p1.  Thanks.

--

-- 
Darren Tucker (dtucker at zip.com.au)
GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4  37C9 C982 80C7 8FF4 FA69
     Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.
Corinna Vinschen | 21 Sep 2009 11:12
Picon
Favicon

Re: Read buffer size in clientloop.c

On Aug 28 11:22, Darren Tucker wrote:
> Corinna Vinschen wrote:
>> Hi Darren,
>>
>> On Jul 10 11:33, Corinna Vinschen wrote:
>>> On Jul  7 21:53, Darren Tucker wrote:
>>>> On Tue, Jul 07, 2009 at 12:57:16PM +0200, Corinna Vinschen wrote:
>>>>> 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?
>>>> If there's a measureable performance gain (which it sounds like there is)
>>>> then I personally have no objection to making it a compile time option.
>>>> Damien?  Maybe something like this?
>>> I tested this patch and it works fine for Cygwin.
>>
>> Will this patch be checked in at one point?
>
> Yes, it was just committed and will be in 5.3p1.  Thanks.

Thanks,
Corinna

--

-- 
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat

Gmane