Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
2.1k views
in .NET FTP by (120 points)
Hi,

I am using the trial version of edtFTPnet/PRO 4.2.0. When I use the regular FTPConnection to connect to a unix box, it is very fast. If I use the SecureFTPConnection to connect to the same unix box, it is about 30 times slower than the FTPConnection.

The following is the code snippet:

SecureFTPConnection ftpCxn = new SecureFTPConnection();
ftpCxn.ServerAddress = "servername";
ftpCxn.UserName = "username";
ftpCxn.Password = "password";
ftpCxn.Protocol = FileTransferProtocol.SFTP;
ftpCxn.AuthenticationMethod = AuthenticationType.PublicKey;
ftpCxn.ServerValidation = SecureFTPServerValidationType.None;
ftpCxn.ClientPrivateKeyFile = "C:\\private.key";
ftpCxn.ServerPort = 22;
ftpCxn.Connect();

ftpCxn.ChangeWorkingDirectory("directory");
foreach (FTPFile myFile in ftpCxn.GetFileInfos())
{
Console.WriteLine("File name: {0}", myFile.Name);
}

If I loop the above code for execution 10 times, it took more than 30 seconds to finish. However for the regular FTPConnection, loop 10 time only took less than 1 second.

Does the SecureFTPConnection suppose to be slower than FTPConnection or is there something wrong with the code?

1 Answer

0 votes
by (162k points)
Regular FTP is not encrypted - there is a large overhead in encrypting all the data that is transferred when using SecureFTPConnection (via SFTP or FTPS). So regular FTP will always be significantly faster.

Also, there is a large overhead in SFTP when initially connecting and authenticating, so if you are connecting and disconnecting each time that will impact performance.

Having said all that there is an enhancement in 4.2.1 (which has just been released) which should improve SFTP performance.

Categories

...