Skip to content

Fix sftp upload performance#4782

Merged
MichaelEischer merged 3 commits intorestic:masterfrom
MichaelEischer:fix-sftp-performance
May 12, 2024
Merged

Fix sftp upload performance#4782
MichaelEischer merged 3 commits intorestic:masterfrom
MichaelEischer:fix-sftp-performance

Conversation

@MichaelEischer
Copy link
Copy Markdown
Member

What does this PR change? What problem does it solve?

Since pkg/sftp 1.13.0 files were uploaded sequentially using 32kb chunks instead of sending 64 chunks in parallel.

This PR now uses ReadFromWithConcurrency instead of ReadFrom to ensure concurrently uploads. The upload size detection in ReadFrom is not able to retrieve the upload size from the RewindReader and therefore only uploaded chunks sequentially.

Was the change previously discussed in an issue or on the forum?

Fixes #4209 .

Checklist

  • I have read the contribution guidelines.
  • I have enabled maintainer edits.
  • I have added tests for all code changes.
  • [ ] I have added documentation for relevant changes (in the manual).
  • There's a new file in changelog/unreleased/ that describes the changes for our users (see template).
  • I have run gofmt on the code in all commits.
  • All commit messages are formatted in the same style as the other commits in the repo.
  • I'm done! This pull request is ready for review.

Since pkg/sftp 1.13.0 files were uploaded sequentially using 32kb chunks
instead of sending 64 chunks in parallel.
This should increase upload throughput for high latency links a bit.
Copy link
Copy Markdown
Member Author

@MichaelEischer MichaelEischer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@MichaelEischer MichaelEischer merged commit b5fdb1d into restic:master May 12, 2024
@MichaelEischer MichaelEischer deleted the fix-sftp-performance branch May 12, 2024 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Slow SFTP transfer rate since 0.12.1

1 participant