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

github workflow: use GOMEMLIMIT to limit mem usage #610

Closed

Conversation

ivanvc
Copy link
Member

@ivanvc ivanvc commented Nov 15, 2023

Remove the comment and switch from GOGC to GOMEMLIMIT as the project uses Go 1.21.

Fixes #609.

Remove the comment and switch from `GOGC` to `GOMEMLIMIT` as the
project uses Go 1.21.

Signed-off-by: Ivan Valdes <[email protected]>
Copy link
Member

@fuweid fuweid left a comment

Choose a reason for hiding this comment

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

LGTM

Thanks for updating.
I was thinking we should use large runner to test. Never mind, it should be other pull request.

Copy link
Member

@jmhbnz jmhbnz left a comment

Choose a reason for hiding this comment

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

Comparing actions run times with this pr things look pretty normal compared to historic and all green. Thanks for tidying this up @ivanvc.

@ivanvc
Copy link
Member Author

ivanvc commented Nov 15, 2023

I was thinking we should use large runner to test. Never mind, it should be other pull request.

@fuweid, I can work on it in another PR, do you have a reference of how to define a large runner?

@fuweid
Copy link
Member

fuweid commented Nov 15, 2023

@ivanvc you can try to use ubuntu-latest-8-cores. If it doesn't work, it needs maintainers to enable the runner for this repo.

REF: etcd-io/etcd@3f6a5c0

@ivanvc
Copy link
Member Author

ivanvc commented Nov 15, 2023

@ivanvc you can try to use ubuntu-latest-8-cores. If it doesn't work, it needs maintainers to enable the runner for this repo.

REF: etcd-io/etcd@3f6a5c0

Thanks, I'll try it out.

@ahrtr
Copy link
Member

ahrtr commented Nov 15, 2023

I was thinking we should use large runner to test.

We should consider to use larger runner for the following tests which used to run longer than other workflows,

  • race enabled test: including both amd64 and arm64
  • windows: include test-window and window coverage

#
# REF: https://github.com/actions/runner-images/issues/6680#issuecomment-1335778010
GOGC=30 CPU=4 ENABLE_RACE=true make test
GOMEMLIMIT=2048MiB CPU=4 ENABLE_RACE=true make test
Copy link
Member

Choose a reason for hiding this comment

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

Based on the Suggested uses in https://tip.golang.org/doc/gc-guide,

  • Don't use the memory limit when deploying to an execution environment you don't control.
  • Don't set a memory limit to avoid out-of-memory conditions when a program is already close to its environment's memory limits.

Also the default value for GOGC is 100, which should be good enough.

What we can do is to try to use larger runner.

So can we just remove the configuration? I mean we don't use GOGC, nor GOMEMLIMIT?

Copy link
Member

Choose a reason for hiding this comment

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

The original issue seems to imply jobs are being killed due to excessive resource usage: actions/runner-images#6680 and based on discussion / linked issues it appears to be ongoing.

However I don't actually know if we are still impacted by this, based on the comments we were historically.

Agree let's try large runner for longer jobs and see if we can just remove it altogether. We can always reinstate the limit if necessary.

Copy link
Member Author

Choose a reason for hiding this comment

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

These changes would change the approach for this PR. I pushed them to #612.

Copy link
Member

Choose a reason for hiding this comment

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

The GOGC was used to prevent from unexpected kill. I think the issue is still here if we don't use larger size runner.
Yeah, I prefer to abort this one and use #612.

Copy link
Member Author

Choose a reason for hiding this comment

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

Would using the large runner just for the race test case make sense? And leave the others with the regular runner? I can change the implementation if that sounds good.

Copy link
Member

Choose a reason for hiding this comment

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

SGTM - 4cpu race (amd64 +arm64) and windows tests are the ones that need extra resources.

@jmhbnz
Copy link
Member

jmhbnz commented Nov 16, 2023

Closing in favor of #612.

@jmhbnz jmhbnz closed this Nov 16, 2023
@ivanvc ivanvc deleted the use-gomemlimit-rather-than-gogc branch November 16, 2023 22:55
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.

Use GOMEMLIMIT instead of GOGC to limit GitHub test workflow memory
4 participants