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

Use smaller per part size to use lower memory #3935

Closed
wants to merge 2 commits into from

Conversation

harshavardhana
Copy link

  • I added CHANGELOG entry for this change.
  • Change is not relevant to the end user.

Changes

Verification

Copy link
Member

@bwplotka bwplotka left a comment

Choose a reason for hiding this comment

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

I think this is changing what was actually intended in the configuration as PartSize, let's figure out solution first on issue. Also ideally any of such changes will be benchmarked first, before applying 🤗

pkg/objstore/s3/s3.go Outdated Show resolved Hide resolved
pkg/objstore/s3/s3.go Outdated Show resolved Hide resolved
@bwplotka bwplotka mentioned this pull request Mar 20, 2021
2 tasks
@bwplotka bwplotka changed the title use smaller per part size to use lower memory Use smaller per part size to use lower memory Mar 24, 2021
@bwplotka bwplotka changed the base branch from main to release-0.19 March 24, 2021 15:47
Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
@bwplotka
Copy link
Member

bwplotka commented Mar 24, 2021

Performed some benchmarks and added benchmark to this PR 🤗

	// Uploading 100MB with:
	// PartSize: 1024 * 1024 * 100 = BenchmarkUpload-12    	      84	 416025119 ns/op	421129826 B/op	     946 allocs/op  (400MB allocated for single op)
	// ParSize:  1024 * 1024 * 25  = BenchmarkUpload-12    	     100	 273648888 ns/op	106639830 B/op	    1576 allocs/op (100MB overallocated).
	// PartSize: 1024 * 1024 * 8   = BenchmarkUpload-12    	      97	 254052232 ns/op	35392395 B/op	    3078 allocs/op (Still 33MB allocated [8x4])

As expected @harshavardhana, wonder how it was before this change against race? 🤔

EDIT:

I reverted the race fix locally on my branch and the result is:

// PartSize: 1024 * 1024 * 100 = BenchmarkUpload-12    	      88	 282906636 ns/op	 1671249 B/op	     907 allocs/op
// PartSize: 1024 * 1024 * 8 =BenchmarkUpload-12    	     100	 300660587 ns/op	 2195440 B/op	    3044 allocs/op

The difference is significant.

@bwplotka
Copy link
Member

Thanks for help @harshavardhana 🤗

Closing this in favor of #3968

@bwplotka bwplotka closed this Mar 24, 2021
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.

2 participants