1

We are using the class SecureFileTransferClient for transferring the files using SFTP protocol. There are some performance issues in the file transfer (i.e. taking longer). We are looking for solutions to improve the performance.

Class: com.enterprisedt.net.ftp.SecureFileTransferClient (Version 4.0.0 Jar)

While creating the client object (SecureFileTransferClient), we are setting the basic parameters like timeout, username, password, protocol, remote host etc.

Question 1: Is there any other parameters which can be set to improve the performance (i.e. transfer speed)?

Question 2: As an alternative, I have looked at SSHFTPClient class and can transfer files using test program. I am not sure when SSHFTPClient class should be used compared to SecureFileTransferClient class. Whether performance can be improved if we use SSHFTPClient class?

My requirement is to use SFTP. So I don't need to change the protocol which is very easy in SecureFileTransferClient (i.e. by calling setProtocol method). Is there any other advantage of using SecureFileTransferClient rather than SSHFTPClient?

com.enterprisedt.net.ftp.ssh.SSHFTPClient

Other questions:-

3) What is the default encryption used by SecureFileTransferClient? Is there an option to set the fastest encryption logarithm?

4) Is there an option to set the buffer size?

5) Any other mechanism to improve the performance?

notionquest
  • 37,595
  • 6
  • 111
  • 105

1 Answers1

1

For the information of readers, this pertains to edtFTPj/PRO, a commercial Java file transfer client.

Firstly confirm that there is a performance issue, i.e. check how it compares to other clients such as Filezilla and WinSCP. If there is a significant performance difference then something should be able to be done about it.

SecureFileTransferClient uses SSHFTPClient for SFTP, so ultimately the performance of these two classes should be identical. SecureFileTransferClient offers connection pooling and asynchronous methods, so if you don't require these features SSHFTPClient is fine to use by itself.

The biggest performance enhancement will be allowing parallel writes for uploads. You can set this with either class (but I think it is the default). Worth checking it is enabled.

Default encryption used will have an impact, for example Blowfish is faster than 3DES. In SSHFTPClient use setAlgorithmEnabled to enable/disable ciphers. Use disableAllAlgorithms(SSHFTPAlgorithm.CIPHER) to disable all ciphers, then enable Blowfish. The server must also support Blowfish of course.

In practice changing the buffer size seems to make very little difference to performance. But the SSH packet size can have an impact - use setMaxPacketSize() to experiment. Try sizes from 500 up to 64000.

Bruce Blackshaw
  • 986
  • 1
  • 7
  • 10
  • Thanks! I can see setParallelMode method in SSHFTPClient, but not on SecureFileTransferClient. Same for setMaxPacketSize, setAlgorithmEnabled methods. Currently, we are mainly using uploadByteArray in SecureFileTransferClient, does it use Async? – notionquest Aug 25 '16 at 09:21
  • Yes, uploadByteArray calls uploadByteArrayAsync, if that's what you're asking. – HansA Aug 25 '16 at 23:33