From: Lyons, Allen <Allen.L<yons@tu...> - 2004-08-20 18:22:55
I have noticed that I am only getting a 5 meg/per minute transfer rate over our corporate lan while using JSCH SFTP. The computer running the library is a P4 3.0GHz machine with 1 gig of ram. When I use any other sftp program such as the one created for the PuTTY package, I get at least 10 times better performance. I saw that someone else posted a message with a similar problem: http://sourceforge.net/mailarchive/forum.php?thread_id=3651559&forum_id=12628
The reply to that message suggested that the problem is that the receiving end of the channel is using a PipedInputStream, and that it uses a 1024 byte buffer. It was suggested that this buffer is causing the packets to break into too many pieces, greatly increasing the overhead of the send.
I rewrote both of the piped classes to use a much larger buffer and it didn't help. The slowness was coming from the sending of the packet to the server. I used an open source java profiler named EJP to find out where the time was spent. It says that its actually taking significantly more time (up to 40ms of cpu time per Session.sendWrite) to encrypt the packets using the Session.encode function than to send the file or wait for a response on each send. Most of the time spent in the JCE library functions. Is there anything that I can do to improve the performance of the encryption?
TBS Enterprise Applications