Documentation
¶
Index ¶
Constants ¶
View Source
const ( DefaultCgroupParent = "/nomad" ReservedCpusetCgroupName = "reserved" )
Variables ¶
This section is empty.
Functions ¶
func FindCgroupMountpointDir ¶
FindCgroupMountpointDir is used to find the cgroup mount point on a Linux system.
func GetCPUsFromCgroup ¶
Types ¶
type CgroupPathGetter ¶
CgroupPathGetter is a function which returns the cgroup path and any error which ocured during cgroup initialization. It should block until the cgroup has been created or an error is reported
type CpusetManager ¶
type CpusetManager interface {
// Init should be called before any tasks are managed to ensure the cgroup parent exists and
// check that proper permissions are granted to manage cgroups.
Init() error
// AddAlloc adds an allocation to the manager
AddAlloc(alloc *structs.Allocation)
// RemoveAlloc removes an alloc by ID from the manager
RemoveAlloc(allocID string)
// CgroupPathFor returns a callback for getting the cgroup path and any error that may have occurred during
// cgroup initialization. The callback will block if the cgroup has not been created
CgroupPathFor(allocID, taskName string) CgroupPathGetter
}
CpusetManager is used to setup cpuset cgroups for each task. A pool of shared cpus is managed for tasks which don't require any reserved cores and a cgroup is managed seperetly for each task which require reserved cores.
func NewCpusetManager ¶
func NewCpusetManager(cgroupParent string, logger hclog.Logger) CpusetManager
func NoopCpusetManager ¶
func NoopCpusetManager() CpusetManager
Click to show internal directories.
Click to hide internal directories.