cgroup

package
v0.0.0-...-d9cb129 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2022 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CgroupMountDir = "/tmp/rjob/cgroup"
)

Set a few constants for simplicity. These could be read from a configuration.

Variables

This section is empty.

Functions

func Mount

func Mount(mountDir string) error

Mount will mount the cgroup hierarchy at mountDir.

func Umount

func Umount(mountDir string) error

Umount unmounts the cgroup hierarchy mounted at mountDir.

Types

type CgroupConfig

type CgroupConfig struct {
	Name string

	Cpu    int
	Memory int
	Io     int

	Path string
}

CgroupConfig is used to create, delete, and manage a cgroup.

func (*CgroupConfig) Create

func (cg *CgroupConfig) Create() error

Create will create the configured cgroup and set the limits for cpu, memory, and io.

func (*CgroupConfig) Delete

func (cg *CgroupConfig) Delete() error

Delete will delete the configured cgroup by removing the directory. Processes int the cgroup must be killed or moved before deleting.

Jump to

Keyboard shortcuts

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