forked from cs3org/reva
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
s3ng: Provide objectSize when uploading
According to the documentation for `PutObject`, setting objectSize to -1 causes a multipart Put operation until the input stream reaches EOF, which can result in high memory usage. Something similar has already been reported in minio/minio-go#1496 This PR changes the behavior so it tries to determine the file size before uploading it. Should the given io.Reader not be a file, it falls back to using `-1`. In my testing this change has reduced the memory usage when uploading files to OICS quite a bit: From over 1GB for a single user, down to <300MB.
- Loading branch information
1 parent
fcb7a30
commit 1b2643a
Showing
2 changed files
with
16 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Bugfix: Provide file size when uploading with S3ng storage | ||
|
||
The memory usage could be high when uploading bigger files using the S3ng storage. | ||
By providing the actual file size, the upload partSize can now be properly determined, reducing | ||
the overall memory usage. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters