Skip to content

Conversation

@DomParfitt
Copy link
Contributor

@DomParfitt DomParfitt commented Aug 21, 2025

@DomParfitt DomParfitt requested a review from a team as a code owner August 21, 2025 09:15
@notthepoint
Copy link
Contributor

Sorry, for my own understanding, could you explain why we're doing this? 🤔

@DomParfitt
Copy link
Contributor Author

Sorry, for my own understanding, could you explain why we're doing this? 🤔

Yep. Go has a setting called GOMAXPROCS, which is used to set the number of CPU cores available to the Go runtime and has some default behaviour to detect the CPU count when it's not explicitly specified. Unfortunately that CPU detect was not container aware (until recently) so the auto detection didn't work properly when running a Go binary in a container. Because of that we (and pretty much everyone else using Go in production) use a package called automaxprocs, which correctly sets GOMAXPROCS when running in a container. As of Go 1.25 the CPU detection in Go is now container aware, so that package is no longer needed.

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.

4 participants