Files
runc/man/runc-update.8.md
Kir Kolyshkin 52390d6804 Ignore kernel memory settings
This is somewhat radical approach to deal with kernel memory.

Per-cgroup kernel memory limiting was always problematic. A few
examples:

 - older kernels had bugs and were even oopsing sometimes (best example
   is RHEL7 kernel);
 - kernel is unable to reclaim the kernel memory so once the limit is
   hit a cgroup is toasted;
 - some kernel memory allocations don't allow failing.

In addition to that,

 - users don't have a clue about how to set kernel memory limits
   (as the concept is much more complicated than e.g. [user] memory);
 - different kernels might have different kernel memory usage,
   which is sort of unexpected;
 - cgroup v2 do not have a [dedicated] kmem limit knob, and thus
   runc silently ignores kernel memory limits for v2;
 - kernel v5.4 made cgroup v1 kmem.limit obsoleted (see
   https://github.com/torvalds/linux/commit/0158115f702b).

In view of all this, and as the runtime-spec lists memory.kernel
and memory.kernelTCP as OPTIONAL, let's ignore kernel memory
limits (for cgroup v1, same as we're already doing for v2).

This should result in less bugs and better user experience.

The only bad side effect from it might be that stat can show kernel
memory usage as 0 (since the accounting is not enabled).

[v2: add a warning in specconv that limits are ignored]

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2021-04-12 12:18:11 -07:00

2.0 KiB

% runc-update "8"

NAME

runc update - update container resource constraints

SYNOPSIS

runc update [command options] <container-id>

DESCRIPTION

The data can be read from a file or the standard input, the accepted format is as follow (unchanged values can be omitted):

{ "memory": { "limit": 0, "reservation": 0, "swap": 0, "kernel": 0, "kernelTCP": 0 }, "cpu": { "shares": 0, "quota": 0, "period": 0, "realtimeRuntime": 0, "realtimePeriod": 0, "cpus": "", "mems": "" }, "blockIO": { "blkioWeight": 0 } }

Note: if data is to be read from a file or the standard input, all other options are ignored.

OPTIONS

--resources value, -r value  path to the file containing the resources to update or '-' to read from the standard input
--blkio-weight value         Specifies per cgroup weight, range is from 10 to 1000 (default: 0)
--cpu-period value           CPU CFS period to be used for hardcapping (in usecs). 0 to use system default
--cpu-quota value            CPU CFS hardcap limit (in usecs). Allowed cpu time in a given period
--cpu-rt-period value        CPU realtime period to be used for hardcapping (in usecs). 0 to use system default
--cpu-rt-runtime value       CPU realtime hardcap limit (in usecs). Allowed cpu time in a given period
--cpu-share value            CPU shares (relative weight vs. other containers)
--cpuset-cpus value          CPU(s) to use
--cpuset-mems value          Memory node(s) to use
--memory value               Memory limit (in bytes)
--memory-reservation value   Memory reservation or soft_limit (in bytes)
--memory-swap value          Total memory usage (memory + swap); set '-1' to enable unlimited swap
--pids-limit value           Maximum number of pids allowed in the container (default: 0)
--l3-cache-schema            The string of Intel RDT/CAT L3 cache schema
--mem-bw-schema              The string of Intel RDT/MBA memory bandwidth schema