[systemd-devel] show container limits?
Lennart Poettering
lennart at poettering.net
Mon Jul 4 17:04:44 UTC 2022
On Mo, 04.07.22 12:37, Harald Dunkel (harald.dunkel at aixigo.com) wrote:
> Hi folks,
>
> systemctl status does a nice job showing LXC containers and their
> process trees, but I wonder if it could show memory and cpu limits,
> memory utilization, swap, etc as well, even if the LXC or docker or
> whatever container wasn't started by systemd? cgroup1 and unified,
> if possible.
systemctl status shows memory/cpu limits of the cgroups/units it
manages. If docker/lxc create per-container units through systemd,
then this should just work. but it really depends how they implemented
stuff.
To my knowledge docker not implementing the delegation
model of cgroups at all, and just fucks around in the tree directly at
random places, hence systemd won't know about it at all... i.e. they
refuse to acknowledge the existance of this, because they think
systemd is stupid, or something like that:
https://systemd.io/CGROUP_DELEGATION
LXC is better and follow these docs, to my knowledge, but not sure
which model they actually followed — i.e. the model of "one unit per
container" or the model of "a single unit for all containers". If the
latter you cannot use systemd tools to inspect or manage resources.
You can use "systemd-cgtop" to show current resource usage of any
cgroup (regardless if managed by systemd or not), but it doesn't show
limits bein enforced, but that would probably make sense to add...
Lennart
--
Lennart Poettering, Berlin
More information about the systemd-devel
mailing list