Subject: [libssh2] How to increase performance of libssh2 SFTP Read/Write

[libssh2] How to increase performance of libssh2 SFTP Read/Write

From: Kamal Bhatt <>
Date: Tue, 5 Jun 2007 12:17:59 +0530

I am reading/writing to Remote SFTP server using libssh2 library. However
there is very poor performance compared to the sftp utility comes along with

I am using *libssh2-0.14 *version.

I tried to investigate the library and found that for Read maximum packet
size is 40000 bytes and for write there is a loop going which will send the
data in chunks of 32KB.

I then tried to increase the SFTP Packet size by changing
LIBSSH2_SFTP_PACKET_MAXLEN to 64KB hoping that then we can read/write in
chunks of 64KB but of no use since after building the library even it was
not able to establish the session with the remote SFTP server.

I also tried changing various constants like

But still I was not able to increase the performance.

Is there some way that by changing these constants or some other things we
can increase the performance SFTP read/write using libssh2 or any other
workaround so as to how to increase the performance?

Any pointers from you will be of great help.

( Please help me about workarounds on *libssh2-0.14 *version for increasing
perofrmance as I have tested my entire application using this version of
library and moving to new version will be very difficult for me)

Thanks in advance.

This email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.

libssh2-devel mailing list
Received on 2007-06-11