Subject: RE: Why SFTP performance sucks, and how to fix it

From: [email-masked] (Peter Gutmann)
Date: Fri, 11 Jul 2003 05:20:22 +1200

"denis bider" <[email-masked]> writes:

>I totally agree that the SSH protocol in some places is more complicated than
>it needs to be; however, the protocol does not impede performance if properly
>implemented. 

That's the magic phrase: "If properly implemented".  The problem is that the
current design makes it extremely tricky to get good performance, borne out by
the fact that after five(?) years of existence of the spec and work on the
code, there are a large number of handbrake-enabled implementations around
with poor performance that is often noticeable enough for it to be an FAQ.

>The protocol provides you with the means to control the flow of the session,
>but it doesn't tell you how to do it efficiently. If you want to resolve
>this, the solution is to write a document describing how to use the control
>elements for best performance; not to remove them altogether. The protocol is
>fine.

I disagree, again based on the modem-protocol experience.  You can make it
simple and straightforward, with good performance, and get good
interoperability (Zmodem) or make it really hard to get right, get OK
performance if you can manage to tune it sufficiently, and get poor
interoperability because no-one can quite get it right (most of Zmodem's
successors).  The fact that I did a truly ghastly (but high-performance) SFTP
implementation in a few hours that outperformed ones that have had years of
ongoing development indicates that waiting for people to tune something that
is inherently difficult to get good performance out of isn't a viable option.

(Before people start reaching for cream pies: The point I'm trying to make
 there isn't to bash other people's software (my experimental code is
 definitely far worse than anything else out there), but to say that the
 current flow-control model is inherently difficult to get good performance
 out of, a claim that would seem to be strongly supported by the performance
 of various existing implementations).

Peter.

---

From: Markus Friedl <[email-masked]>
Date: Thu, 10 Jul 2003 22:04:36 +0200

>  of various existing implementations).

But for SFTP it's due to the fact that the early implementations
used to send only one request at a time.  E.g., when sending multiple
'read' requests, I see not much different in performance between
scp and sftp (For a window size that's only 4 times the packet size).

-m