maxprocs

package
v0.9.17 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2024 License: BSD-3-Clause Imports: 9 Imported by: 0

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:

  1. If $GOMAXPROCS is set, Set relinquishes control to the Go runtime. This should cause the runtime to respect this value directly.
  2. 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.
  3. 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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL