sshj icon indicating copy to clipboard operation
sshj copied to clipboard

sftp transfer speed is different scp speed

Open melihbirim opened this issue 14 years ago • 5 comments

Hello,

I am using your library version 0.8 for file transfer over sftp. However upload speed over sftp using sshj library does not match normal sftp file transfer.

if I transfer a file with ftp speed is 1Mb/s with sftp using sshj speed is 1Mb/s with sftp speed is 10Mb/s with scp speed is 10Mb/s with scp using sshj speed is 10Mb/s

What migth be the reason for differences? Thanks

melihbirim avatar Jun 06 '12 14:06 melihbirim

Thanks for pointing out the speed difference. Comparing sshj speeds against openssh & ironing out any issues seems like a worthwhile exercise, I will try to get around to it soon.

shikhar avatar Jun 13 '12 14:06 shikhar

I think that this low transfer speed is due to the fact that only one single part of a file is provided to / requested from the server at a time. By consequence, the latency between the server and the client impact dramaticaly the transfert speed.

I programmed a patch for ganymed ssh that fasten a lot the upload. It is easy to code for the upload but very hard for the download because of the java streams shape (writting lazily is easy but reading ahead of time is very hard). I will try to submit a patch for the uploading part.

romainreuillon avatar Dec 11 '12 22:12 romainreuillon

The upload has been made a lot faster by merge pull request #97.

Speeding up the download using read ahead is however significantly harder.

romainreuillon avatar Jan 07 '13 07:01 romainreuillon

I have written a patch to improve download transfer speeds in https://github.com/dkocher/sshj/commit/f354fd66615ddf70401e8a7191a15ffc4dd11f45

dkocher avatar May 09 '14 12:05 dkocher

This merge does not exists in the latest mvn release 0.35.0. Currently the upload speed using RemoteFileOutputStream is VERY slow!

mironabr avatar Apr 19 '23 10:04 mironabr