Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pkg/thread: use GOMAXPROCS instead of NumCPU (bufbuild#912)
In modern production environments, NumCPU is a poor estimate of the actual parallelism available: it does consult the population count of the cpuset mask (if any), but doesn't account for cgroups v1 or v2. Both are commonly used in containerized environments. The intention of this code is (I think?) to prevent us from burning memory on initial stacks for zillions of goroutines, so we should just use GOMAXPROCS: by definition, it's the maximum number of goroutines that can run in parallel.
- Loading branch information