Skip to content

Commit

Permalink
set part size for s3:CopyObject minimum 128Mb, look details https://r…
Browse files Browse the repository at this point in the history
  • Loading branch information
Slach committed Mar 24, 2024
1 parent 30579e6 commit 5e41c8b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# v2.4.35
IMPROVEMENTS
- set part size for `s3:CopyObject` minimum 128Mb, look details https://repost.aws/questions/QUtW2_XaALTK63wv9XLSywiQ/s3-sync-command-is-slow-to-start-on-some-data

# v2.4.34
BUG FIXES
- fixed wrong behavior for CLICKHOUSE_SKIP_TABLES_ENGINES for engine=EngineName without parameters
Expand Down
5 changes: 3 additions & 2 deletions pkg/storage/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -492,8 +492,9 @@ func (s *S3) CopyObject(ctx context.Context, srcSize int64, srcBucket, srcKey, d
if srcSize%s.Config.MaxPartsCount > 0 {
partSize++
}
if partSize < 5*1024*1024 {
partSize = 5 * 1024 * 1024
// 128Mb part size recommendation from https://repost.aws/questions/QUtW2_XaALTK63wv9XLSywiQ/s3-sync-command-is-slow-to-start-on-some-data
if partSize < 128*1024*1024 {
partSize = 128 * 1024 * 1024
}

// Calculate the number of parts
Expand Down

0 comments on commit 5e41c8b

Please sign in to comment.