OpenSSH GSoC Project

Damien Miller djm at mindrot.org
Thu Mar 26 09:57:32 EST 2009


On Wed, 25 Mar 2009, Pavel Labath wrote:

> Also, I had an idea about decreasing latency on small file transfers.
> Right now a small (< chunk size) file needs 3 message-response pairs to
> transfer -- open, read/write, close (although the last could be, in
> theory, sent even before the second completes). However, if we add a
> message "open file X, read/write Y bytes and (possibly) close it" then
> it could be done in one round-trip. And one could send a bunch of these
> messages together. This works best for upload since you know the size of
> the file, but download could benefit as well. On the other hand, it
> complicates the protocol (what should be done if open succeeds, but
> write fails? ...) so I'm not sure if it's worth it, I'm just
> brainstorming here. I suppose testing would be needed.

I think the way to do this is to pipeline the opens as well as the
read/writes. I.e. open a (small) window of file handles at the start of a 
multi-file transfer and maintain this window as file transfers complete.
So an upload session might look like this:

C->S		open(a)
C->S		open(b)
S->C		handle for a
C->S		open(c)
S->C		handle for b
C->S		open(d)
S->C		handle for c
C->S		block 0..512 for a
S->C		handle for d
C->S		block 512..1024 for a
S->C		ack for a
C->S		block 1024..1536 for a
S->C		ack for a
C->S		close(a)
C->S		open(e)
S->C		ack for a
C->S		block 0..512 for b
S->C		ack for close a
S->C		handle for e
C->S		block 512..1024 for b

... and so forth

Also, we don't pipeline readdir() calls at the moment - this is another
easy opportunity for improvement.

-d


More information about the openssh-unix-dev mailing list