cgroup

package
v0.0.0-...-c5bc0ce Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(name string) (sandbox.CGroup, error)

New create and initialize new default implementation of `sandbox.Cgroup`. TODO: search cgroup filesystem path.

Types

type CPU

type CPU interface {
	Limiter
	Limit(duration time.Duration) error
	Usage() time.Duration
}

CPU limit cpu usage of processes inside sandbox. This will monitor cpu usage, and kill process when cpu usage is exceeding limit. This will also cancel the context returned by `Context` method when processes inside cgroup exceeding limit.

type Limiter

type Limiter interface {
	Context() context.Context
	Prepare() error
	Put(process *os.Process) error
}

Limiter limit process resource using linux cgroup. Limiter gives context that will be cancelled when process inside cgroup exceeding limit.

type Memory

type Memory interface {
	Limiter
	Limit(bytes uint64) error
	Throttle(bytes uint64) error
	Usage() uint64
}

Memory limit memory usage of processes inside sandbox. This will monitor memory usage, and kill process when maximum memory usage is exceeding limit. This will also cancel the context returned by `Context` method when processes inside cgroup exceeding limit.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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