forked from bnb-chain/bsc
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/geth: use automaxprocs to apply cpu quota correctly (#21)
### Description upstream PR: [go-ethereum#27506](ethereum/go-ethereum#27506) As discussed with @rjl493456442 offline, if Geth was running in a container with CPU quota(set with cgroup limiting), and runtime.NumCPU returns the host's CPU cores(maybe bigger than the docker's setting), which may result in more Golang runtime schedule and context switch. So I'm using the [uber/atomaxprocs](https://github.com/uber-go/automaxprocs) package to return the correct cpu quota.
- Loading branch information
Showing
3 changed files
with
7 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters