Subject: Re: read-window fix?

Re: read-window fix?

From: Nathan Myers <ncm_at_cantrip.org>
Date: Tue, 19 Feb 2013 14:37:05 -0800

> Sun, 17 Feb 2013 09:03:39 -0500 Ben Kibbey <bjk_at_luxsci.net>
>> On Wed, 16 Jan 2013 18:24:04 -0800, Nathan Myers writes:
>> This patch seems to improve matters, for the slow.c just posted.
>> I'm not sure I understand all the implications of moving the adjust
>> after the read, but I don't see how to know the right adjustment to
>> apply without reading first: I very frequently get short reads from
>> this function.

> This patch works well for me. Without it and when doing alot of short
> reads from an SSH server the download rate drops sharply after about
> 200K. With this patch applied the speed is as it is from the beginning
> for the duration of the entire transfer.

Just for the record, I'm not suggesting using this patch in production.
It's just a way of demonstrating the effect of window-adjust latency.

One cause of the slowdown is that window adjustment messages are being
lost, as a result of a bug in _libssh2_transport_send that I am
preparing a fix for. (See trac #256) I think, too, that we need to
maintain a minimum window not just the size of the user read buffer,
but of that plus the bandwidth-delay product. If the total of readable
bytes plus the remaining receive window goes below, say, 32K, that is
probably a failure. If the receive window size ever reaches zero on
an empty buffer, that's a serious failure.

Nathan Myers
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2013-02-19