cmd/geth: use automaxprocs to apply cpu quota correctly (#27506)

It is usually best to set GOMAXPROCS to the number of available CPU cores. However, setting
it like that does not work well when the process is quota-limited to a certain number of CPUs.
The automaxprocs library configures GOMAXPROCS, taking such limits into account.
This commit is contained in:
Delweng
2023-07-14 19:14:47 +02:00
committed by GitHub
parent 13c0305106
commit 47b9f1b4ae
3 changed files with 7 additions and 0 deletions
+3
View File
@@ -44,6 +44,9 @@ import (
_ "github.com/ethereum/go-ethereum/eth/tracers/js"
_ "github.com/ethereum/go-ethereum/eth/tracers/native"
// Automatically set GOMAXPROCS to match Linux container CPU quota.
_ "go.uber.org/automaxprocs"
"github.com/urfave/cli/v2"
)