Subject: Re: SFTP Compression support

Re: SFTP Compression support

From: Ezequiel Ruiz <>
Date: Wed, 01 Sep 2010 16:32:56 -0300

  The buffer values I've mentioned where just for the SSH packet
payloads, I didn't touch the decompression buffers (just applied your
patch). Regarding the profiler, I'll make some tests this night, I'm not
sure if increasing the LIBSSH2_CHANNEL_WINDOW_DEFAULT value will affect
the performance, but I'll try it too.



El 01/09/2010 03:34 p.m., TJ Saunders escribió:
>> I've just compiled the "sftp_nonblock.c" example, and tried it with an 80 MB
>> text file in a remote Linux server. I've commented the line where the output
>> is printed in the stdout to avoid performance penalties. The problem is that
>> using the compression flag takes more time that without the using the
>> compression flag! I've tried several times, and all the tests returned the
>> same results: about 120 seconds with the compression flag, and about 90
>> seconds without it.
> Can you use profiling, like ltrace or strace or something similar, to get
> a better idea of where that extra time is being spent?
>> I've tried with buffers of 1K, 16K and 32K.
> Are these buffers used for the size of the SSH packet payloads, or for the
> decompression?
>> The compression is enabled at the OpenSSH server side, if I try the transfer
>> with an SFTP client, like the sftp command, then it takes about 10 or 20
>> seconds.
> Another possibility is the size of the channel window that libssh2 uses.
> libssh2 has a channel window size of 64K (LIBSSH2_CHANNEL_WINDOW_DEFAULT,
> from libssh2.h); OpenSSH (at least looking at the 5.2p1 sources I have
> handy) shows a channel window size of 2048K. A smaller window size
> results in more back-and-forth traffic; you might try increasing
> LIBSSH2_CHANNEL_WINDOW_DEFAULT to see if that affects your tests.
> Cheers,
> TJ
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Where is the Life we have lost in living?
> Where is the wisdom we have lost in knowledge?
> Where is the knowledge we have lost in information?
> -T.S. Eliot
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> _______________________________________________
> libssh2-devel

Received on 2010-09-01