Archived Forum Post

Index of archived forum posts

Question:

Download speed sftp

Feb 08 '17 at 20:25

I am using chilkat sftp for my Objective-C macOS application and I get good upload speed but miserable download speed.

I use 9.5.0.65 and the following code to download:

    //  Open a file on the server:
    NSString *handle = [sftp OpenFile: ftpFile access: @"readOnly" createDisp: @"openExisting"];
    if (sftp.LastMethodSuccess != YES) {
        NSLog(@"%@",sftp.LastErrorText);
        return;
    }

    //  Download the file:
    success = [sftp DownloadFile: handle toFilePath: downloadFile];

and for upload:

    //  Open a file for writing on the SSH server.
    //  If the file already exists, it is overwritten.
    //  (Specify "createNew" instead of "createTruncate" to
    //  prevent overwriting existing files.)
    NSString *handle = 0;
    handle = [sftp OpenFile: [ftpToDir stringByAppendingPathComponent:ftpPartFile] access: @"writeOnly" createDisp: @"createTruncate"];
    if (handle == nil ) {
        NSLog(@"%@",sftp.LastErrorText);
        return;
    }

    currentTransferBytes = fileToUpload.filesize;
    //  Upload from the local file to the SSH server.
    success = [sftp UploadFile: handle fromFilePath: fileToUpload.filepath];

I have done some tests where I use 70 files, total 2,34 GB

Uploadtime Filezilla: 2:40 (1 file at a time) Chilkat: 2:34

Downloadtime Filezilla: 1:17 (1 file at a time) Chilkat: 7:05

I have also tried using

    success = [sftp DownloadFileByName: ftpFile localFilePath: downloadFile];

and got the same result.

I also tried to play with

sftp.SoRcvBuf = [NSNumber numberWithInt:64*4096]; // 262144

but this didn’t change anything.

Am I doing something wrong?

Kind regards /Nikolai


Answer

Hi Nickel,

I'm going to send post a new build for you to test..


Answer

The new build is ready. Here's the URL: http://chilkatdownload.com/prerelease/chilkat-9.5.0-macosx-objc.zip