Documentation ¶
Overview ¶
Package automax automatically sets GOMEMLIMIT & GOMAXPROCS to match the linux container memory & cpu quotas, if any.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetCpu ¶
func SetCpu(c ...config) func()
SetCpu puts GOMAXPROCS to match the linux container cpu quota (if any), returning an undo function.
It is a no-op in environments without a configured cpu quota.
The optional argument c is only used for internal test purposes.
Example ¶
package main import ( "github.com/komuw/ong/automax" ) func main() { undo := automax.SetCpu() defer undo() }
Output:
func SetMem ¶
func SetMem(c ...config) func()
SetMem puts GOMEMLIMIT to match the linux container memory quota (if any), returning an undo function.
It is a no-op in environments without a configured memory quota.
The optional argument c is only used for internal test purposes.
Example ¶
package main import ( "github.com/komuw/ong/automax" ) func main() { undo := automax.SetMem() defer undo() }
Output:
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.