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

[zstd] test low memory options #475

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mostynb
Copy link
Collaborator

@mostynb mostynb commented Sep 22, 2021

Let's see how this affects memory usage and performance.

Related to #473.

Let's see how this affects memory usage and performance.

Related to buchgr#473.
@mostynb
Copy link
Collaborator Author

mostynb commented Sep 23, 2021

@BoyangTian-Robinhood if you get a chance to try this out, please let me know how it goes.

@BoyangTian-Robinhood
Copy link

BoyangTian-Robinhood commented Sep 24, 2021

I did some tests, run some bazel test for same packages by cherry-pick this changes on top of [disk] drain any remaining data before Put returns and without cherry-pick this changes. (The numbers shows below is a rough number, I ran 2 times for each cases and just use round number here)

Summary

With this commit. Compare zstd with uncompressed:

zstd highest memory is 3 times higher than without zstd, and when it stable zstd memory is 1.74 times higher. For disk saving it is around 3.29 times saving with zstd.

Without this commit. Compare zstd with uncompressed:

zstd highest memory is 3.8 times higher than without zstd, and when it stable zstd memory is 2.3 times higher. For disk saving it is around 3.29 times saving with zstd.

Compare with this commit and without this commit zstd saving:

memory saving on peak is 1.04 times. memory saving on stable is 1.12 times. And disk has no change.

But it seems zstd also has memory leak issue even with grpc goroutines fix
I can still see goroutines number stay increase by bazel clean each time

goroutine 112377 [chan receive, 4 minutes]:
github.com/klauspost/compress/zstd.(*Decoder).startStreamDecoder(0xc00f7b0e60, 0xc00a6f07b8)
	external/com_github_klauspost_compress/zstd/decoder.go:484 +0x230
created by github.com/klauspost/compress/zstd.(*Decoder).Reset
	external/com_github_klauspost_compress/zstd/decoder.go:202 +0x1ef

Detail

Start new service without anything there, memory is around 6MB.

Head is this commit (647f07b)

With zstd options

memory peak is 1.54GB, stable is 268MB, disk is: 677MB

Still this commit by using --storage_mode=uncompressed

memory peak is 513MB, stable is 154MB, disk is: 2.23GB

Head is without this commit but with grpc goroutine fix (cc0a82a)

With using options :

memory peak is 1.6GB, stable is 300MB, disk is: 677MB

Still this commit by using --storage_mode=uncompressed

memory peak is 420MB, stable is 129MB, disk is: 2.23GB

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