Skip to content

Commit

Permalink
use smaller per part size to use lower memory
Browse files Browse the repository at this point in the history
  • Loading branch information
harshavardhana authored and bwplotka committed Mar 24, 2021
1 parent 1dce996 commit 325ad7d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/objstore/s3/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ var DefaultConfig = Config{
MaxConnsPerHost: 0,
},
// Minimum file size after which an HTTP multipart request should be used to upload objects to storage.
// Set to 128 MiB as in the minio client.
PartSize: 1024 * 1024 * 128,
// Set to 16 MiB as in the minio client.
PartSize: 1024 * 1024 * 16,
}

// Config stores the configuration for s3 bucket.
Expand Down Expand Up @@ -452,7 +452,7 @@ func (b *Bucket) Upload(ctx context.Context, name string, r io.Reader) error {
// partSize cannot be larger than object size.
partSize := b.partSize
if size < int64(partSize) {
partSize = 0
partSize = size // set partSize to the object size
}
if _, err := b.client.PutObject(
ctx,
Expand Down

0 comments on commit 325ad7d

Please sign in to comment.