Skip to content

Best value for MAX_SFTP_READ_SIZE #21

Closed

Description

@Zenju

Hi,

I have an 1,5 MB/sec bandwidth internet connection. When using libssh2 out of the box I only get 600 kb/sec download speed. However when I set MAX_SFTP_READ_SIZE to 20.000 instead of only 2000, I get about 1,4 MB/sec download speed.

Now when I set MAX_SFTP_READ_SIZE to 200.000 I get corrupted downloads (but no error codes from libssh2 whatsoever). So it seems at some point correctness is broken.

What is the highest value for MAX_SFTP_READ_SIZE that I can set without breaking correctness?

Thanks, except for the speed issue everything else works fine, also the new 1.6.0 release!

PS: curiously if I use 2.000.000 for MAX_SFTP_READ_SIZE speed is down to 700 kb / sec, but the downloaded files are not corrupted anymore!

Activity

  1. bagder commented on Jun 12, 2015

    @bagder
    Member

    MAX_SFTP_READ_SIZE is 30000 as of commit d754fee

  2. bagder commented on Jun 12, 2015

    @bagder
    Member

    The bandwidth is not the key issue here, the RTT is.

  3. Zenju commented on Jun 12, 2015

    @Zenju
    ContributorAuthor

    Awesome! I'm going to use 30.000 with the 1.6.0 release then, this will solve the download speed issue for my scenario!

    PS: I downloaded and tested the 1.6.1 dev version from today, Jun 12, 2015, but I'm getting download corruption: one test file has 367 bytes, but libssh2_sftp_read returns with 0 (100% reproducible)! But if I try to debug it, the problem goes away and libssh2_sftp_read returns with the correct 367 bytes...

  4. added a commit that references this issue on Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions