Hacker GitHub

← All repos

uber-go/automaxprocs

View on GitHub ↗ ★ 4,853 Go

Automatically set GOMAXPROCS to match Linux container CPU quota.

10 mentions on Hacker News by 9 people: 0 stories, 10 comments · first 2020-09-02 · latest 2025-05-21

Mentions per year 10 mentions · busiest year 2023 (3)
20082026
  1. …cgroup to see if that got done or not, but didn't check when it got done. As said in 2019, import https://github.com/uber-go/automaxprocs to get the functionality ASAP.
    comment by yencabulator · 2025-05-21 · in Understanding the Go Scheduler
  2. …> You still need to use a helper library like https://github.com/KimMachineGun/automemlimit or https://github.com/uber-go/automaxprocs . I would be surprised if the Go team implemented it into the runtime, because some devs would love to…
  3. …. You still need to use a helper library like https://github.com/KimMachineGun/automemlimit or https://github.com/uber-go/automaxprocs . Go 1.19 only had this in its notes for memory changes "...includes support for a soft memory limit.…
    comment by lenkite · 2025-02-19 · in One year after switching from Java to Go
  4. …[6]: https://kanishk.io/posts/cpu-throttling-in-containerized-go-... [7]: https://github.com/uber-go/automaxprocs
    comment by imiric · 2024-09-29 · in Some Go web dev notes
  5. …as well as https://stackoverflow.com/a/65554131/207384 to get the /sys paths to read from. Or use https://github.com/uber-go/automaxprocs , which is very comprehensive, but is a bunch of code for what should be a simple task.
    comment by telotortium · 2023-11-08 · in Go, Containers, and the Linux Scheduler
  6. We use https://github.com/uber-go/automaxprocs after we joyfully discovered that Go assumed we had the entire cluster's cpu count on any particular pod. Made for some very strange performance characteristics in scheduling goroutines.
    comment by sethammons · 2023-11-07 · in Go, Containers, and the Linux Scheduler
  7. …use https://github.com/KimMachineGun/automemlimit to automatically set this this limit, kinda like https://github.com/uber-go/automaxprocs .
    comment by rickette · 2023-11-07 · in Go, Containers, and the Linux Scheduler
  8. …Some of them have started using [automaxprocs] to automatically detect and set. [automaxprocs]: https://github.com/uber-go/automaxprocs
  9. …are not something they ever manually configured, hence it's surprising how they interact. I ship https://github.com/uber-go/automaxprocs in all of my open source stuff to avoid bug reports about this particular issue. Fun stuff! :) DNS…
    comment by jrockway · 2021-02-11 · in Kubernetes Failure Stories
  10. …you used more than 1 CPU, but since you can't (modulo forks, of course), it won't happen. There is https://github.com/uber-go/automaxprocs to set this automatically, if you care. You are right that by default, the logic that sets…