Documentation ¶
Overview ¶
Package maxprocs optimizes GOMAXPROCS for Infrared environments. It attempts to balance application performance with cluster-level resource utilization. Applications may tune GOMAXPROCS as necessary (see Set). The defaults in this package are subject to change.
NOTE: this is manually copied from internal baseplate/v2/internal/maxprocs/maxprocs.go
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Set ¶
func Set()
Set configures the runtime's GOMAXPROCS using the following heuristic:
- If $GOMAXPROCS is set, Set relinquishes control to the Go runtime. This should cause the runtime to respect this value directly.
- If $BASEPLATE_CPU_REQUEST is unset/invalid, Set relinquishes control to automaxprocs, minimum 2. See https://pkg.go.dev/go.uber.org/automaxprocs for specific behavior.
- Otherwise, $BASEPLATE_CPU_REQUEST is multiplied by $BASEPLATE_CPU_REQUEST_SCALE (or defaultCPURequestScale) to compute the new GOMAXPROCS, minimum 2.
Set also exports several metrics to facilitate further tuning/analysis.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.