runtimex

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2023 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KB = 1 << (10 * iota)
	MB
	GB
	TB
	PB
)

Variables

This section is empty.

Functions

func SetGoMaxProcPercent

func SetGoMaxProcPercent(p int) error

SetGoMaxProcPercent

use percent to reset runtime.GOMAXPROCS. when in container system, SetGoMaxProcPercent will skip all action
@argument:
  p: range 1 100

@example:
  1:
    vcpu := 8
    p := 10     # means 10% of cpu resource
    GOMAXPROCS equal to 1
  2:
    vcpu := 10
    p := 20     # means 20% of cpu resource
    GOMAXPROCS equal to 2

func SetGoMemoryLimit

func SetGoMemoryLimit(memString string) error

SetGoMemoryLimit

use percent to reset debug.SetMemoryLimit. when in container system, SetGoMemoryLimit will skip all action
@argument:
  memString: <int><unit>
    :int: valid int
    :unit: B,KB,MB,GB,TB,PB. case insensitive. unit configuration empty means 'B'

func SetGoMemoryLimitPercent

func SetGoMemoryLimitPercent(p int) error

SetGoMemoryLimitPercent

use percent to reset debug.SetMemoryLimit. when in container system, SetGoMemoryLimitPercent will skip all action
@argument:
  p: range 1 100

Types

This section is empty.

Jump to

Keyboard shortcuts

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