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

Update GOMEMLIMIT recommendation in readme #965

Merged
merged 1 commit into from
Feb 20, 2025

Conversation

alexbozhenko
Copy link
Contributor

https://go.dev/doc/gc-guide#:~:text=Do%20take%20advantage,is%20unaware%20of.
says:

In this case, a good rule of thumb is to leave an additional 5-10% of headroom to account for memory sources the Go runtime is unaware of.

We see in practice that memory can grow quickly, leading to OOMs.

Adjust the recommendation to 80%.

Links:
A related issue in k8s on setting the value to a percentage of memlimit: kubernetes/kubernetes#91514

https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#how-pods-with-resource-limits-are-run

https://pkg.go.dev/runtime/debug#SetMemoryLimit

Copy link
Member

@wallyqs wallyqs left a comment

Choose a reason for hiding this comment

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

LGTM

@wallyqs wallyqs merged commit 14785ef into nats-io:main Feb 20, 2025
5 checks passed
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