LoginSignup
0
0

More than 3 years have passed since last update.

Golang - Incorrect CPU Numbers of GOMAXPROCS in Docker

Last updated at Posted at 2019-11-27

The runtime.GOMAXPROCS(??) will read the host machine's CPU numbers instead of container's (--cpus=??). We can use UBER's automaxprocs to solve it.

go get -u go.uber.org/automaxprocs
import _ "go.uber.org/automaxprocs"

func main() {
  // Your application logic here.
}

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0