Please take a look at these changes. I have gone from a 2K SFTP request size to 32K (based on JavaScript buffer size) and eliminated the intermediate vector of chars, which has approximately doubled my performance. I went from about 5 Mbit/sec to about 10 Mbit/sec on my local network.
I believe most of the gain is due to the large SFTP request size, even though the client always comes back with 2000 bytes at a time; libssh2 is actually pipelining the requests more efficiently behind the scenes.
Please take a look at these changes. I have gone from a 2K SFTP request size to 32K (based on JavaScript buffer size) and eliminated the intermediate vector of chars, which has approximately doubled my performance. I went from about 5 Mbit/sec to about 10 Mbit/sec on my local network.
I believe most of the gain is due to the large SFTP request size, even though the client always comes back with 2000 bytes at a time; libssh2 is actually pipelining the requests more efficiently behind the scenes.