Skip to content

cgroup

The limits and the usage of the cgroup (v2) a worker runs in.

cpu_quota

cpu_quota(root=CGROUP_ROOT)

The number of cores the CPU quota of cpu.max allows.

Parameters:

Name Type Description Default
root Path

The directory of the cgroup.

CGROUP_ROOT

Returns:

Type Description
int | None

The quota over the period, rounded down and at least 1, or None without a

int | None

quota or without the file.

memory_limit

memory_limit(root=CGROUP_ROOT)

The memory limit of memory.max in bytes, None without a limit.

memory_anon

memory_anon(root=CGROUP_ROOT)

The anonymous memory of memory.stat (anon) in bytes.

The memory the processes allocated, without the page cache which memory.peak counts and the kernel reclaims at the limit instead of killing.

Returns:

Type Description
int | None

The bytes, None without the file or the field.

memory_oom_kills

memory_oom_kills(root=CGROUP_ROOT)

The processes of the cgroup the out of memory killer killed (oom_kill).

The counter of memory.events, the evidence of a kill for memory: a process which exits 137 may have been killed by anyone with SIGKILL.

Returns:

Type Description
int | None

The count, None without the file or the field.

cpu_throttled_seconds

cpu_throttled_seconds(root=CGROUP_ROOT)

The seconds the processes of the cgroup waited for its CPU quota.

throttled_usec of cpu.stat: time a process could have run but the quota of cpu.max held it back, the evidence that a task needs more cores.

Returns:

Type Description
float | None

Seconds, None without the file or the field.