Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

storj: performance improvement for large file uploads #7198

Merged
merged 1 commit into from Aug 4, 2023

Conversation

kaloyan-raev
Copy link
Contributor

@kaloyan-raev kaloyan-raev commented Aug 1, 2023

What is the purpose of this change?

storj.io/uplink v1.11.0 has an improved logic for uploading large files where file segments are uploaded concurrently instead of serially. This allows to fully utilize the network connection during the entire upload process.

This change enables the new upload logic.

Was the change discussed in an issue or in the forum before?

No.

Checklist

  • I have read the contribution guidelines.
  • I have added tests for all changes in this PR if appropriate.
  • I have added documentation for the changes if appropriate.
  • All commit messages are in house style.
  • I'm done, this Pull Request is ready for review :-)

storj.io/uplink v1.11.0 comes with an improved logic for uploading large
files where file segments are uploaded concurrently instead of serially.
This allows to fully utilize the network connection during the entire
upload process.

This change enable the new upload logic.
@kaloyan-raev
Copy link
Contributor Author

Result from integration tests against Storj:

=== RUN   TestIntegration
    fstests.go:423: Using remote "TestStorj:"
=== RUN   TestIntegration/FsCheckWrap
    fstests.go:464: Not a wrapping Fs
=== RUN   TestIntegration/FsCommand
    fstests.go:492: No commands in this remote
=== RUN   TestIntegration/FsRmdirNotFound
=== RUN   TestIntegration/FsString
=== RUN   TestIntegration/FsName
=== RUN   TestIntegration/FsRoot
=== RUN   TestIntegration/FsRmdirEmpty
=== RUN   TestIntegration/FsMkdir
=== RUN   TestIntegration/FsMkdir/FsMkdirRmdirSubdir
    fstest.go:250: Filtering empty directory "dir"
    fstest.go:250: Filtering empty directory "dir/subdir"
    fstest.go:250: Filtering empty directory "dir"
=== RUN   TestIntegration/FsMkdir/FsListEmpty
=== RUN   TestIntegration/FsMkdir/FsListDirEmpty
=== RUN   TestIntegration/FsMkdir/FsListRDirEmpty
=== RUN   TestIntegration/FsMkdir/FsListDirNotFound
=== RUN   TestIntegration/FsMkdir/FsListRDirNotFound
=== RUN   TestIntegration/FsMkdir/FsEncoding
=== RUN   TestIntegration/FsMkdir/FsEncoding/control_chars
    fstests.go:689: testing "␀␁␂␃␄␅␆␇␈␉␊␋␌␍␎␏␐␑␒␓␔␕␖␗␘␙␚␛␜␝␞␟␡"
=== RUN   TestIntegration/FsMkdir/FsEncoding/dot
    fstests.go:689: testing "."
=== RUN   TestIntegration/FsMkdir/FsEncoding/dot_dot
    fstests.go:689: testing ".."
=== RUN   TestIntegration/FsMkdir/FsEncoding/punctuation
    fstests.go:689: testing "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~"
=== RUN   TestIntegration/FsMkdir/FsEncoding/leading_space
    fstests.go:689: testing " leading space"
=== RUN   TestIntegration/FsMkdir/FsEncoding/leading_tilde
    fstests.go:689: testing "~leading tilde"
=== RUN   TestIntegration/FsMkdir/FsEncoding/leading_CR
    fstests.go:689: testing "␍leading CR"
=== RUN   TestIntegration/FsMkdir/FsEncoding/leading_LF
    fstests.go:689: testing "␊leading LF"
=== RUN   TestIntegration/FsMkdir/FsEncoding/leading_HT
    fstests.go:689: testing "␉leading HT"
=== RUN   TestIntegration/FsMkdir/FsEncoding/leading_VT
    fstests.go:689: testing "␋leading VT"
=== RUN   TestIntegration/FsMkdir/FsEncoding/leading_dot
    fstests.go:689: testing ".leading dot"
=== RUN   TestIntegration/FsMkdir/FsEncoding/trailing_space
    fstests.go:689: testing "trailing space "
=== RUN   TestIntegration/FsMkdir/FsEncoding/trailing_CR
    fstests.go:689: testing "trailing CR␍"
=== RUN   TestIntegration/FsMkdir/FsEncoding/trailing_LF
    fstests.go:689: testing "trailing LF␊"
=== RUN   TestIntegration/FsMkdir/FsEncoding/trailing_HT
    fstests.go:689: testing "trailing HT␉"
=== RUN   TestIntegration/FsMkdir/FsEncoding/trailing_VT
    fstests.go:689: testing "trailing VT␋"
=== RUN   TestIntegration/FsMkdir/FsEncoding/trailing_dot
    fstests.go:689: testing "trailing dot."
=== RUN   TestIntegration/FsMkdir/FsEncoding/invalid_UTF-8
    fstests.go:689: testing "invalid utf-8\xfe"
=== RUN   TestIntegration/FsMkdir/FsEncoding/URL_encoding
    fstests.go:689: testing "test%46.txt"
=== RUN   TestIntegration/FsMkdir/FsNewObjectNotFound
=== RUN   TestIntegration/FsMkdir/FsPutError
2023/08/01 20:23:49 ERROR : FS sj://rclone-test-tebuden8xicefes9cawoleb8: cp input ./hello? sausage/êé/Hello, 世界/ " ' @ < > & ? + ≠/z.txt []: potato
=== RUN   TestIntegration/FsMkdir/FsPutZeroLength
=== RUN   TestIntegration/FsMkdir/FsOpenWriterAt
    fstests.go:762: FS has no OpenWriterAt interface
=== RUN   TestIntegration/FsMkdir/FsChangeNotify
    fstests.go:798: FS has no ChangeNotify interface
=== RUN   TestIntegration/FsMkdir/FsPutFiles
=== RUN   TestIntegration/FsMkdir/FsPutFiles/FsListDirFile2
=== RUN   TestIntegration/FsMkdir/FsPutFiles/FsListRDirFile2
=== RUN   TestIntegration/FsMkdir/FsPutFiles/FsListR
=== RUN   TestIntegration/FsMkdir/FsPutFiles/FsListRSubdir
=== RUN   TestIntegration/FsMkdir/FsPutFiles/FsListDirRoot
=== RUN   TestIntegration/FsMkdir/FsPutFiles/FsListRDirRoot
=== RUN   TestIntegration/FsMkdir/FsPutFiles/FsListSubdir
=== RUN   TestIntegration/FsMkdir/FsPutFiles/FsListRSubdir#01
=== RUN   TestIntegration/FsMkdir/FsPutFiles/FsListLevel2
=== RUN   TestIntegration/FsMkdir/FsPutFiles/FsListRLevel2
=== RUN   TestIntegration/FsMkdir/FsPutFiles/FsListFile1
=== RUN   TestIntegration/FsMkdir/FsPutFiles/FsNewObject
=== RUN   TestIntegration/FsMkdir/FsPutFiles/FsNewObjectCaseInsensitive
    fstests.go:1051: Not Case Insensitive
=== RUN   TestIntegration/FsMkdir/FsPutFiles/FsListFile1and2
=== RUN   TestIntegration/FsMkdir/FsPutFiles/FsNewObjectDir
=== RUN   TestIntegration/FsMkdir/FsPutFiles/FsPurge
=== RUN   TestIntegration/FsMkdir/FsPutFiles/FsCopy
=== RUN   TestIntegration/FsMkdir/FsPutFiles/FsMove
=== RUN   TestIntegration/FsMkdir/FsPutFiles/FsDirMove
    fstests.go:1225: FS has no DirMover interface
=== RUN   TestIntegration/FsMkdir/FsPutFiles/FsRmdirFull
=== RUN   TestIntegration/FsMkdir/FsPutFiles/FsPrecision
=== RUN   TestIntegration/FsMkdir/FsPutFiles/ObjectString
=== RUN   TestIntegration/FsMkdir/FsPutFiles/ObjectFs
=== RUN   TestIntegration/FsMkdir/FsPutFiles/ObjectRemote
=== RUN   TestIntegration/FsMkdir/FsPutFiles/ObjectHashes
=== RUN   TestIntegration/FsMkdir/FsPutFiles/ObjectModTime
=== RUN   TestIntegration/FsMkdir/FsPutFiles/ObjectMimeType
    fstests.go:1358: MimeType method not supported
=== RUN   TestIntegration/FsMkdir/FsPutFiles/ObjectMetadata
    fstests.go:1387: Metadata method not supported
=== RUN   TestIntegration/FsMkdir/FsPutFiles/ObjectSetModTime
    fstests.go:1454: can't set modified time
=== RUN   TestIntegration/FsMkdir/FsPutFiles/ObjectSize
=== RUN   TestIntegration/FsMkdir/FsPutFiles/ObjectOpen
=== RUN   TestIntegration/FsMkdir/FsPutFiles/ObjectOpenSeek
=== RUN   TestIntegration/FsMkdir/FsPutFiles/ObjectOpenRange
=== RUN   TestIntegration/FsMkdir/FsPutFiles/ObjectPartialRead
=== RUN   TestIntegration/FsMkdir/FsPutFiles/ObjectUpdate
=== RUN   TestIntegration/FsMkdir/FsPutFiles/ObjectStorable
=== RUN   TestIntegration/FsMkdir/FsPutFiles/FsIsFile
=== RUN   TestIntegration/FsMkdir/FsPutFiles/FsIsFileNotFound
=== RUN   TestIntegration/FsMkdir/FsPutFiles/FromRoot
    fstests.go:1596: Opening root remote "TestStorj:" path "rclone-test-tebuden8xicefes9cawoleb8" from "TestStorj:rclone-test-tebuden8xicefes9cawoleb8"
=== RUN   TestIntegration/FsMkdir/FsPutFiles/FromRoot/List
=== RUN   TestIntegration/FsMkdir/FsPutFiles/FromRoot/ListEntries
=== RUN   TestIntegration/FsMkdir/FsPutFiles/FromRoot/ListR
=== RUN   TestIntegration/FsMkdir/FsPutFiles/FromRoot/Put
=== RUN   TestIntegration/FsMkdir/FsPutFiles/FromRoot/Put/Remove
=== RUN   TestIntegration/FsMkdir/FsPutFiles/PublicLink
    fstests.go:151: Put error: bucket was not available, now created, the upload must be retried - low level retry 1/10
=== RUN   TestIntegration/FsMkdir/FsPutFiles/SetTier
    fstests.go:397: FS has no SetTier & GetTier interfaces
=== RUN   TestIntegration/FsMkdir/FsPutFiles/ObjectCheckWrap
    fstests.go:1794: Not a wrapping Fs
=== RUN   TestIntegration/FsMkdir/FsPutFiles/ObjectRemove
=== RUN   TestIntegration/FsMkdir/FsPutFiles/ObjectAbout
    fstests.go:1828: FS does not support About
=== RUN   TestIntegration/FsMkdir/FsPutFiles/FsPutStream
=== RUN   TestIntegration/FsMkdir/FsPutFiles/FsPutStream/0
=== RUN   TestIntegration/FsMkdir/FsPutFiles/FsPutStream/100
    fstests.go:151: PutStream error: uplink: too many requests - low level retry 1/10
=== RUN   TestIntegration/FsMkdir/FsPutFiles/Internal
    fstests.go:1890: *storj.Fs does not implement InternalTester
=== RUN   TestIntegration/FsMkdir/FsPutChunked
    fstests.go:1911: *storj.Fs does not implement SetUploadChunkSizer
=== RUN   TestIntegration/FsMkdir/FsUploadUnknownSize
=== RUN   TestIntegration/FsMkdir/FsUploadUnknownSize/FsPutUnknownSize
=== RUN   TestIntegration/FsMkdir/FsUploadUnknownSize/FsUpdateUnknownSize
=== RUN   TestIntegration/FsMkdir/FsRootCollapse
=== RUN   TestIntegration/FsShutdown
    fstests.go:2107: Shutdown method not supported
--- PASS: TestIntegration (78.03s)
    --- SKIP: TestIntegration/FsCheckWrap (0.00s)
    --- SKIP: TestIntegration/FsCommand (0.00s)
    --- PASS: TestIntegration/FsRmdirNotFound (0.55s)
    --- PASS: TestIntegration/FsString (0.00s)
    --- PASS: TestIntegration/FsName (0.00s)
    --- PASS: TestIntegration/FsRoot (0.00s)
    --- PASS: TestIntegration/FsRmdirEmpty (0.27s)
    --- PASS: TestIntegration/FsMkdir (76.69s)
        --- PASS: TestIntegration/FsMkdir/FsMkdirRmdirSubdir (1.38s)
        --- PASS: TestIntegration/FsMkdir/FsListEmpty (0.16s)
        --- PASS: TestIntegration/FsMkdir/FsListDirEmpty (0.22s)
        --- PASS: TestIntegration/FsMkdir/FsListRDirEmpty (0.14s)
        --- PASS: TestIntegration/FsMkdir/FsListDirNotFound (0.18s)
        --- PASS: TestIntegration/FsMkdir/FsListRDirNotFound (0.15s)
        --- PASS: TestIntegration/FsMkdir/FsEncoding (31.95s)
            --- PASS: TestIntegration/FsMkdir/FsEncoding/control_chars (1.57s)
            --- PASS: TestIntegration/FsMkdir/FsEncoding/dot (1.48s)
            --- PASS: TestIntegration/FsMkdir/FsEncoding/dot_dot (1.56s)
            --- PASS: TestIntegration/FsMkdir/FsEncoding/punctuation (1.81s)
            --- PASS: TestIntegration/FsMkdir/FsEncoding/leading_space (1.90s)
            --- PASS: TestIntegration/FsMkdir/FsEncoding/leading_tilde (1.53s)
            --- PASS: TestIntegration/FsMkdir/FsEncoding/leading_CR (1.60s)
            --- PASS: TestIntegration/FsMkdir/FsEncoding/leading_LF (1.50s)
            --- PASS: TestIntegration/FsMkdir/FsEncoding/leading_HT (1.50s)
            --- PASS: TestIntegration/FsMkdir/FsEncoding/leading_VT (1.52s)
            --- PASS: TestIntegration/FsMkdir/FsEncoding/leading_dot (2.46s)
            --- PASS: TestIntegration/FsMkdir/FsEncoding/trailing_space (1.70s)
            --- PASS: TestIntegration/FsMkdir/FsEncoding/trailing_CR (1.83s)
            --- PASS: TestIntegration/FsMkdir/FsEncoding/trailing_LF (1.65s)
            --- PASS: TestIntegration/FsMkdir/FsEncoding/trailing_HT (1.66s)
            --- PASS: TestIntegration/FsMkdir/FsEncoding/trailing_VT (1.49s)
            --- PASS: TestIntegration/FsMkdir/FsEncoding/trailing_dot (1.51s)
            --- PASS: TestIntegration/FsMkdir/FsEncoding/invalid_UTF-8 (1.99s)
            --- PASS: TestIntegration/FsMkdir/FsEncoding/URL_encoding (1.54s)
        --- PASS: TestIntegration/FsMkdir/FsNewObjectNotFound (0.30s)
        --- PASS: TestIntegration/FsMkdir/FsPutError (0.18s)
        --- PASS: TestIntegration/FsMkdir/FsPutZeroLength (0.74s)
        --- SKIP: TestIntegration/FsMkdir/FsOpenWriterAt (0.00s)
        --- SKIP: TestIntegration/FsMkdir/FsChangeNotify (0.00s)
        --- PASS: TestIntegration/FsMkdir/FsPutFiles (35.83s)
            --- PASS: TestIntegration/FsMkdir/FsPutFiles/FsListDirFile2 (0.93s)
            --- PASS: TestIntegration/FsMkdir/FsPutFiles/FsListRDirFile2 (0.94s)
            --- PASS: TestIntegration/FsMkdir/FsPutFiles/FsListR (0.14s)
            --- PASS: TestIntegration/FsMkdir/FsPutFiles/FsListRSubdir (0.14s)
            --- PASS: TestIntegration/FsMkdir/FsPutFiles/FsListDirRoot (0.53s)
            --- PASS: TestIntegration/FsMkdir/FsPutFiles/FsListRDirRoot (0.46s)
            --- PASS: TestIntegration/FsMkdir/FsPutFiles/FsListSubdir (0.32s)
            --- PASS: TestIntegration/FsMkdir/FsPutFiles/FsListRSubdir#01 (0.34s)
            --- PASS: TestIntegration/FsMkdir/FsPutFiles/FsListLevel2 (0.48s)
            --- PASS: TestIntegration/FsMkdir/FsPutFiles/FsListRLevel2 (0.18s)
            --- PASS: TestIntegration/FsMkdir/FsPutFiles/FsListFile1 (0.45s)
            --- PASS: TestIntegration/FsMkdir/FsPutFiles/FsNewObject (0.14s)
            --- SKIP: TestIntegration/FsMkdir/FsPutFiles/FsNewObjectCaseInsensitive (0.00s)
            --- PASS: TestIntegration/FsMkdir/FsPutFiles/FsListFile1and2 (0.15s)
            --- PASS: TestIntegration/FsMkdir/FsPutFiles/FsNewObjectDir (0.14s)
            --- PASS: TestIntegration/FsMkdir/FsPutFiles/FsPurge (1.06s)
            --- PASS: TestIntegration/FsMkdir/FsPutFiles/FsCopy (1.08s)
            --- PASS: TestIntegration/FsMkdir/FsPutFiles/FsMove (6.03s)
            --- SKIP: TestIntegration/FsMkdir/FsPutFiles/FsDirMove (0.00s)
            --- PASS: TestIntegration/FsMkdir/FsPutFiles/FsRmdirFull (0.21s)
            --- PASS: TestIntegration/FsMkdir/FsPutFiles/FsPrecision (0.00s)
            --- PASS: TestIntegration/FsMkdir/FsPutFiles/ObjectString (0.15s)
            --- PASS: TestIntegration/FsMkdir/FsPutFiles/ObjectFs (0.16s)
            --- PASS: TestIntegration/FsMkdir/FsPutFiles/ObjectRemote (0.16s)
            --- PASS: TestIntegration/FsMkdir/FsPutFiles/ObjectHashes (0.16s)
            --- PASS: TestIntegration/FsMkdir/FsPutFiles/ObjectModTime (0.16s)
            --- SKIP: TestIntegration/FsMkdir/FsPutFiles/ObjectMimeType (0.15s)
            --- SKIP: TestIntegration/FsMkdir/FsPutFiles/ObjectMetadata (0.15s)
            --- PASS: TestIntegration/FsMkdir/FsPutFiles/ObjectSetModTime (0.28s)
            --- PASS: TestIntegration/FsMkdir/FsPutFiles/ObjectSize (0.20s)
            --- PASS: TestIntegration/FsMkdir/FsPutFiles/ObjectOpen (0.31s)
            --- PASS: TestIntegration/FsMkdir/FsPutFiles/ObjectOpenSeek (0.32s)
            --- PASS: TestIntegration/FsMkdir/FsPutFiles/ObjectOpenRange (0.81s)
            --- PASS: TestIntegration/FsMkdir/FsPutFiles/ObjectPartialRead (0.76s)
            --- PASS: TestIntegration/FsMkdir/FsPutFiles/ObjectUpdate (0.72s)
            --- PASS: TestIntegration/FsMkdir/FsPutFiles/ObjectStorable (0.14s)
            --- PASS: TestIntegration/FsMkdir/FsPutFiles/FsIsFile (0.91s)
            --- PASS: TestIntegration/FsMkdir/FsPutFiles/FsIsFileNotFound (0.81s)
            --- PASS: TestIntegration/FsMkdir/FsPutFiles/FromRoot (1.96s)
                --- PASS: TestIntegration/FsMkdir/FsPutFiles/FromRoot/List (0.46s)
                --- PASS: TestIntegration/FsMkdir/FsPutFiles/FromRoot/ListEntries (0.15s)
                --- PASS: TestIntegration/FsMkdir/FsPutFiles/FromRoot/ListR (0.30s)
                --- PASS: TestIntegration/FsMkdir/FsPutFiles/FromRoot/Put (1.05s)
                    --- PASS: TestIntegration/FsMkdir/FsPutFiles/FromRoot/Put/Remove (0.42s)
            --- PASS: TestIntegration/FsMkdir/FsPutFiles/PublicLink (6.70s)
            --- SKIP: TestIntegration/FsMkdir/FsPutFiles/SetTier (0.00s)
            --- SKIP: TestIntegration/FsMkdir/FsPutFiles/ObjectCheckWrap (0.00s)
            --- PASS: TestIntegration/FsMkdir/FsPutFiles/ObjectRemove (0.48s)
            --- SKIP: TestIntegration/FsMkdir/FsPutFiles/ObjectAbout (0.00s)
            --- PASS: TestIntegration/FsMkdir/FsPutFiles/FsPutStream (4.92s)
                --- PASS: TestIntegration/FsMkdir/FsPutFiles/FsPutStream/0 (0.65s)
                --- PASS: TestIntegration/FsMkdir/FsPutFiles/FsPutStream/100 (4.27s)
            --- SKIP: TestIntegration/FsMkdir/FsPutFiles/Internal (0.00s)
        --- SKIP: TestIntegration/FsMkdir/FsPutChunked (0.00s)
        --- PASS: TestIntegration/FsMkdir/FsUploadUnknownSize (2.76s)
            --- PASS: TestIntegration/FsMkdir/FsUploadUnknownSize/FsPutUnknownSize (0.97s)
            --- PASS: TestIntegration/FsMkdir/FsUploadUnknownSize/FsUpdateUnknownSize (1.79s)
        --- PASS: TestIntegration/FsMkdir/FsRootCollapse (1.30s)
    --- SKIP: TestIntegration/FsShutdown (0.00s)
PASS
ok  	github.com/rclone/rclone/backend/storj	78.053s

Copy link
Member

@ncw ncw left a comment

Choose a reason for hiding this comment

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

I'm happy to merge this as-is - I'd just like to query the use of the private package.

@@ -24,6 +24,7 @@ import (

"storj.io/uplink"
"storj.io/uplink/edge"
"storj.io/uplink/private/testuplink"
Copy link
Member

Choose a reason for hiding this comment

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

We are using something out of private? Maybe it should be public?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is not yet a public API. We will follow with a PR when it becomes a new API or the default behavior of storj.io/uplink. Until it is decided, we want to have this performance improvement in Rclone.

Copy link
Member

Choose a reason for hiding this comment

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

OK. I'll merge as-is and you can send a follow up later.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here is follow up PR: #7305

backend/storj/fs.go Show resolved Hide resolved
@ncw ncw merged commit d63fcc6 into rclone:master Aug 4, 2023
10 checks passed
@ncw
Copy link
Member

ncw commented Aug 4, 2023

Thank you :-)

kaloyan-raev added a commit to kaloyan-raev/rclone that referenced this pull request Sep 14, 2023
The improved upload logic is active by default in uplink v1.12.0, so the
`testuplink.WithConcurrentSegmentUploadsDefaultConfig(ctx)` is not
required anymore.

See rclone#7198
ncw pushed a commit that referenced this pull request Sep 14, 2023
The improved upload logic is active by default in uplink v1.12.0, so the
`testuplink.WithConcurrentSegmentUploadsDefaultConfig(ctx)` is not
required anymore.

See #7198
divyam234 pushed a commit to divyam234/rclone that referenced this pull request Sep 21, 2023
The improved upload logic is active by default in uplink v1.12.0, so the
`testuplink.WithConcurrentSegmentUploadsDefaultConfig(ctx)` is not
required anymore.

See rclone#7198
ncw pushed a commit that referenced this pull request Oct 11, 2023
The improved upload logic is active by default in uplink v1.12.0, so the
`testuplink.WithConcurrentSegmentUploadsDefaultConfig(ctx)` is not
required anymore.

See #7198
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.

None yet

2 participants