feat: allow settings gomaxprocs in workflows#286
Conversation
Signed-off-by: Atze de Vries <atze.wiebe.de.vries@coop.no>
| description: Run mage go related tasks in "docker" (default) or local | ||
| go-maxprocs: | ||
| type: number | ||
| default: 2 |
There was a problem hiding this comment.
@AtzeDeVries maxprocs default is the maximum available cores or in 1.25 the cpu limits of the container:
https://go.dev/blog/container-aware-gomaxprocs
We want Go to provide efficient and reliable defaults when possible, so in Go 1.25, we have made GOMAXPROCS take into account its container environment by default. If a Go process is running inside a container with a CPU limit, GOMAXPROCS will default to the CPU limit if it is less than the core count.
Container orchestration systems may adjust container CPU limits on the fly, so Go 1.25 will also periodically check the CPU limit and adjust GOMAXPROCS automatically if it changes.
Both of these defaults only apply if GOMAXPROCS is otherwise unspecified. Setting the GOMAXPROCS environment variable or calling runtime.GOMAXPROCS continues to behave as before. The runtime.GOMAXPROCS documentation covers the details of the new behavior.
I think this might introduce a potential reduction in performance by defaulting to 2. Do we have to provide a default?
tho in ci/cd it might not be a big deal but in a test suite it might cause unexpected delays
There was a problem hiding this comment.
Note: “core” more precisely means “logical CPU.” (Also scavanged from the post for visibility)
Signed-off-by: Atze de Vries atze.wiebe.de.vries@coop.no