runtime

package
v0.0.0-...-7983b3b Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NumVCPU

func NumVCPU() int

NumVCPU returns the number of virtualizes CPUs available to the process. It should be used instead of runtime.NumCPU() in virtualized environments like K8s to ensure that processes don't attempt to over-subscribe CPUs. For example, on a 16 vCPU machine in a docker container allocated 8 vCPUs, runtime.NumCPU() will return 16 but NumVCPU() will return 8.

func SetMaxProcs

func SetMaxProcs()

SetMaxProcs sets the GOMAXPROCS for the go runtime to a sane value

Types

This section is empty.

Jump to

Keyboard shortcuts

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