Ask Your Question

Revision history [back]

It turned out that the performance issue had nothing to do with the PSH flag. The problem was that the SFTP server had a latency of 300ms for every read-block request. The faster SFTP client masked this delay by queuing up dozens of read-requests and processing the responses asynchronously, whereas the slower one would proceed synchronously, waiting for each response before sending the next one. It was not obvious that the faster client was performing asynchronously because requests were encrypted so I couldn't see which response corresponded to which request and therefore couldn't trace individual block-reads.