Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
854 views
in .NET FTP by (140 points)

Hi there,

I am currently using a trial version of edtFTPnet. As part of my testing, I am downloading a 16MB file from an sFTP site. Using FileZilla, the transfer is taking approximately 12 seconds, but using the DownloadFile method, it is taking approximately 4 minutes.

Here is the code I'm using to download the file:

public void DownloadFile()

        {

            String remoteFolder = "/FOLDERNAME/";

            String localFolder = "c:\\tmp\\";

            String sFtpSite = "SFTPSITE";

            String ftpUsername = "USERNAME";

            String ftpPassword = "PASSWORD";

            String filename = "FILENAME";

            String remoteFile = string.Concat(remoteFolder, filename);

            String localFile = String.Concat(localFolder, filename);

            SecureFTPConnection.LogLevel = EnterpriseDT.Util.Debug.LogLevel.All;

            SecureFTPConnection.LogToConsole = true;

            SecureFTPConnection.LogFile = "c:\\tmp\\log.txt";

            SecureFTPConnection sftp = new SecureFTPConnection();

            sftp.ServerAddress = sFtpSite;

            sftp.UserName = ftpUsername;

            sftp.Password = ftpPassword;

            sftp.ServerPort = 22;

            sftp.ServerValidation = EnterpriseDT.Net.Ftp.SecureFTPServerValidationType.None;

            sftp.Protocol = FileTransferProtocol.SFTP;

            sftp.TransferNotifyInterval = 1024 * 1024;

            sftp.BytesTransferred += sftp_BytesTransferred;

            sftp.Connect();

            Debug.Print(DateTime.Now.ToString("h:mm:ss>") + " About to start download");

            sftp.DownloadFile(localFile, remoteFile);

            Debug.Print(DateTime.Now.ToString("h:mm:ss>") + " Download completed");

        }

        void sftp_BytesTransferred(object sender, BytesTransferredEventArgs e)

        {

            Debug.Print(DateTime.Now.ToString("h:mm:ss> ") + e.ByteCount.ToString() + " bytes downloaded");

        }

Here is the output I'm seeing:

10:08:53> About to start download

10:09:09> 1074300 bytes downloaded

10:09:27> 2148600 bytes downloaded

10:09:43> 3222900 bytes downloaded

10:09:57> 4297200 bytes downloaded

10:10:11> 5371500 bytes downloaded

10:10:25> 6445800 bytes downloaded

10:10:39> 7520100 bytes downloaded

10:10:54> 8594400 bytes downloaded

10:11:07> 9668700 bytes downloaded

10:11:25> 10743000 bytes downloaded

10:11:41> 11817300 bytes downloaded

10:11:57> 12891600 bytes downloaded

10:12:12> 13965900 bytes downloaded

10:12:29> 15040200 bytes downloaded

10:12:46> 16114500 bytes downloaded

10:12:48> Download completed

Here is the log of the same download in FileZilla:

Status: Connected to SFTPSITE

Status: Starting download of /FOLDERNAME/FILENAME

Status: remote:/FOLDERNAME/FILENAME => local:C:\tmp\FILENAME

Status: File transfer successful, transferred 16,164,549 bytes in 12 seconds

Logfile for download

Can you suggest why the download performance might be so different?

Thanks and regards,

Dermot

by (161k points)
To start with, make sure debug logging is turned off.
by (140 points)
OK I turned off debugging - and performance improved. Now it is taking 1min45sec, vs 13sec on FileZilla. Is there anything else it could be? Is speed limited with the trial version?
by (51.1k points)
Make sure you're using an AES or blowfish cipher and not 3DES.
by (140 points)
Thanks for that suggestion. I have tried AES128 and Blowfish - similar performance (just under two minutes, vs 12 seconds in FileZilla). Is it expectted that downloads would be multiple times slower than FileZilla?
by (161k points)
I wouldn't expect this, no. But I'm not sure why you are having the issue. Is it across a LAN or the Internet?
by (140 points)
It?s across the internet. Is there anything else I can do to troubleshoot other than provide the source-code and log files? I would like to use this product for my project but would need to see significantly improved performance. Thanks for your help.
by (51.1k points)
Is it possible to get a test login for your server, so that we can try to replicated this behaviour?

1 Answer

0 votes
by (140 points)
Hello

I'd like to mention that my company has been using edtFTPnet/PRO as part of a product for downloading via SFTP, and we have also seen the same discrepancies in download speed.

Categories

...