docker stats: no cpu, mem and io stats
Hi,
I have an Alpine system 3.19 running in a lxc container on Proxmox 8.1.4. I installed docker and docker-compose which are running currently 13 containers.
Now I want to setup a monitoring for the container. Running docker stats
the value for CPU, Mem and Block IO for all container is 0.
After some research I think the setup of cgroups is the issue. If I activate cgroups V1 in /etc/rc.conf
(rc_cgroup_mode="legacy"
) I get values for CPU, but Mem and Block IO remains at 0.
If cgroups V2 is activated in /etc/rc.conf
(rc_cgroup_mode="unified"
) all values for CPU, Mem and Block IO are 0. The file /sys/fs/cgroup/cgroup.subtree_control
is empty so that no values will be monitored for containers.
Every time I found the hint to add the cmdline parameters group_enable=cpuset cgroup_enable=memory cgroup_memory=1
but I do not find the file cmdline.txt
which I should edit. Most of the times I find the hint for systemd like
$ cat <<EOF | sudo tee /etc/systemd/system/user@.service.d/delegate.conf
[Service]
Delegate=cpu cpuset io memory pids
Is this the correct way to activate the delegation of the cgroup values for container? Where can I find the file cmdline.txt
or something similar?
Thanks for the help!
Kind regards