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

Add GOMEMLIMIT as env variable in Terraform for serverless implementation of Buz #592

Merged
merged 6 commits into from
Apr 26, 2024

Conversation

ricky-galvao
Copy link
Contributor

When running in serverless mode, in particular with AWS Lambda, it has been noted that the Garbage Collector (GC) does not adequately keep up with freeing past execution allocations when handling high rates of requests. As a result, memory allocation grows with reuse of the same lambda container across invocations. This eventually leads to the the container being killed by the Lambda service. This PR sets the GOMEMLIMIT environment variable (both in AWS and GCP) at a default value of 90% max allocated memory. GOMEMLIMIT is a soft memory limit that Go will recognize and start to more aggressively execute GC once reached.

Resolves /issues/591

Copy link
Contributor

@jakthom jakthom left a comment

Choose a reason for hiding this comment

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

🖖 🚀

Signed-off-by: Jake Thomas <aerialfly@gmail.com>
@jakthom jakthom merged commit 6b8c5af into silverton-io:main Apr 26, 2024
2 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.

Make Use of GOMEMLIMIT When in Serverless Mode
2 participants