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

etcdserver/util.go: reduce memory when logging range requests #12871

Conversation

chaochn47
Copy link
Member

When we have multiple excessive large range requests landing on etcd server, the response size warn loggging calling proto.Size() takes 30% of memory allocation, it can be avoided by non-marshal implementation rangeResponse.Size() and give etcd server more headroom to request memory allocation.

Fixes #12835

@chaochn47
Copy link
Member Author

PTAL @gyuho @ptabor, thanks!!

@gyuho
Copy link
Contributor

gyuho commented Apr 16, 2021

Awesome. We have a few other places we call proto.Size

traceutil.Field{Key: "req_size", Value: proto.Size(p)}
proto.Size(txnResponse)

Can we check others as well?

@chaochn47 chaochn47 force-pushed the 20210416-reduce-memory-when-logging-read-requests branch from 212a278 to 7e70ef8 Compare April 16, 2021 20:06
@chaochn47 chaochn47 force-pushed the 20210416-reduce-memory-when-logging-read-requests branch from 7e70ef8 to 4b8969a Compare April 16, 2021 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

proto.Size takes up to 30% memory usage in excesively large range requests
3 participants