-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
Use uber-go/automaxprocs to default GOMAXPROCS aware of Linux CPU Quotas #10950
Comments
A note from the sideline, Hugo bases its parallelism on
So, setting |
Ack, thanks! We're getting good results setting GOMAXPROCS=1 in netlify for Kubernetes (it appears free netlify has ~1 core allocated?)
I think it might? be better to base it on Even without that though, AIUI the setting GOMAXPROCS will let go internally do better at scheduling within the CPU quota. I filed a sample PR in #10951 for the latter, we've seen automaxprocs fix performance issues with containerized Go more generally, e.g. in Kubernetes's CI unit tests. |
I needed to revert this; a new patch that makes the tests pass is welcomed, but I have not time to investigate this at the moment. |
I'll look into that 👀 Thank you for all your work on hugo! |
Great; Ideally I would want no output from that library. |
OK, sorry about that, the root automaxprocs just calls I can repro the failures locally on the last PR from undesired added logging. Filed #10952 |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
See:
GOMAXPROCS
cfs-aware onGOOS=linux
golang/go#33803Basically: When using hugo in a container with limited CPU quota, hugo can encounter CPU throttling issues because GOMAXPROCS is defaulted to the underlying hardware core count instead of the allocated CPU limits in the container.
There's something of a defacto standard library for defaulting this in a CPU limit aware way in https://github.com/uber-go/automaxprocs, at least until golang/go#33803 is solved.
Users would still be able to override by setting
GOMAXPROCS
env, and this is a fairly small MIT licensed dependency.The text was updated successfully, but these errors were encountered: