I've also noted that sftp command line (openssh) often has better download
performance than Jsch.
My understanding is that sftp command line makes simultaneous requests for
data (i.e. have more than one request for data outstanding) while with Jsch
you normally have only one request outstanding - which makes up for the
difference in performance.
If you run sftp with debug flags (-v, can add up to three -vvv) you will
notice this behaviour.
>It seems like JSCH is reading data at 32K chunks, do you have any
>suggestions on how to increase the chunk size JSCH?
The 32kb packet size comes directly from the specification (draft):
http://tools.ietf.org/html/draft-ietf-secsh-filexfer-02#section-3
so I think it would be unwise to change that.
/Håkan
On Thu, Jun 16, 2011 at 9:25 PM, rush gage <rushg...@gmail.com> wrote:
> Hello,
>
> We are currently using JSCH for doing SFTP from a Remote Redhat Linux
> server to a Local Redhat Linux Server.
> The command line SFTP fetches a 100 MB File in 6 seconds, where as the Java
> program using JSCH gets the file in 30 seconds.
> While monitoring netstat on the remote server, we noticed that the Send-Q
> shows a max of 32K waiting for client to read during the SFTP using JSCH,
> but during command line SFTP it shows around 400K waiting for client to
> read.
>
> I tested my application using both release 44 and 45-rc5 and there is no
> difference in performance .
>
> It seems like JSCH is reading data at 32K chunks, do you have any
> suggestions on how to increase the chunk size JSCH?
>
>
> Application log.(the lines one without date is from JSCH)
>
> Thu Jun 16 10:23:15 PDT 2011 Connecting to SFTP Session...
> INFO: Connecting to nnn.nnn.nnn.nnn port 22
> INFO: Connection established
> INFO: Remote version string: SSH-2.0-OpenSSH_4.3
> INFO: Local version string: SSH-2.0-JSCH-0.1.45
> INFO: CheckCiphers:
> aes256-ctr,aes192-ctr,aes128-ctr,aes256-cbc,aes192-cbc,aes128-cbc,3des-ctr,arcfour,arcfour128,arcfour256
> INFO: aes256-ctr is not available.
> INFO: aes192-ctr is not available.
> INFO: aes256-cbc is not available.
> INFO: aes192-cbc is not available.
> INFO: arcfour256 is not available.
> INFO: CheckKexes: diffie-hellman-group14-sha1
> INFO: diffie-hellman-group14-sha1 is not available.
> INFO: SSH_MSG_KEXINIT sent
> INFO: SSH_MSG_KEXINIT received
> INFO: kex: server->client aes128-ctr hmac-md5 none
> INFO: kex: client->server aes128-ctr hmac-md5 none
> INFO: SSH_MSG_KEXDH_INIT sent
> INFO: expecting SSH_MSG_KEXDH_REPLY
> INFO: ssh_rsa_verify: signature true
> WARN: Permanently added 'nnn.nnn.nnn.nnn' (RSA) to the list of known
> hosts.
> INFO: SSH_MSG_NEWKEYS sent
> INFO: SSH_MSG_NEWKEYS received
> INFO: SSH_MSG_SERVICE_REQUEST sent
> INFO: SSH_MSG_SERVICE_ACCEPT received
> INFO: Authentications that can continue:
> gssapi-with-mic,publickey,keyboard-interactive,password
> INFO: Next authentication method: gssapi-with-mic
> INFO: Authentications that can continue:
> publickey,keyboard-interactive,password
> INFO: Next authentication method: publickey
> INFO: Authentication succeeded (publickey).
> Thu Jun 16 10:23:17 PDT 2011 Connecting to SFTP Channel...
> Thu Jun 16 10:23:17 PDT 2011 Connected to SFTP Server...
> Thu Jun 16 10:23:17 PDT 2011 Getting the Input stream....
> Thu Jun 16 10:23:17 PDT 2011 Got the Input stream....
> Thu Jun 16 10:23:17 PDT 2011 Progress....
> 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
> 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
> 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
> 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
> Thu Jun 16 10:23:49 PDT 2011 Copied InputStream into a File....Size:
> 100000000
> Thu Jun 16 10:23:49 PDT 2011 Exiting SFTP connection...
> INFO: Disconnecting from nnn.nnn.nnn.nnn port 22
>
>
>
> Thank you.
> Sree.
>
>
> ------------------------------------------------------------------------------
> EditLive Enterprise is the world's most technically advanced content
> authoring tool. Experience the power of Track Changes, Inline Image
> Editing and ensure content is compliant with Accessibility Checking.
> http://p.sf.net/sfu/ephox-dev2dev
> _______________________________________________
> JSch-users mailing list
> JSch-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jsch-users
>
>
------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
JSch-users mailing list
JSch-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jsch-users