Hi,
I found this tool very nice and I would like to use it to collect performance counters for my containers.
My idea is to run nmon inside each container and have it collect the data only for that container.
Then I can download .nmon files and graph them individually for each container.
However I found out that nmon collects stats about ALL the cpus available on the system, not only the CPUs allowed by the cgroup it's running into.
This means that when I run nmon inside a container it's actually collecting the stats of all other containers as well, and I thus loose the ability to have per-container granularity of the stats.
So this feature request is to add an option (something like --current-cgroup-only) to nmon to collect CPU/memory stats from the cgroups "cpuacct" (CPU accounting) and "memory".
What nmon can do is: read its own mountpoints:
[root@mycontainer ~]# cat /proc/$(pidof nmon)/mounts
...
and search for "cpuacct" and "memory":
[root@mycontainer ~]# cat /proc/$(pidof nmon)/mounts | grep -E "cpuacct|memory"
cgroup_root /sys/fs/cgroup/memory tmpfs ro,relatime,size=10240k,mode=755 0 0
cgroup /sys/fs/cgroup/memory/lxc/mycontainer cgroup rw,nosuid,nodev,noexec,relatime,memory 0 0
cgroup /sys/fs/cgroup/cpu/lxc/mycontainer cgroup rw,nosuid,nodev,noexec,relatime,cpuacct,cpu 0 0
cgroup /sys/fs/cgroup/cpu,cpuacct cgroup rw,nosuid,nodev,noexec,relatime,cpuacct,cpu 0 0
Under the directories
/sys/fs/cgroup/memory/lxc/mycontainer
/sys/fs/cgroup/cpu/lxc/mycontainer
it is then available all the stats in a similar format to /proc
Hi,
I ended up creating a fork of this project at:
https://github.com/f18m/nmon-cgroup-aware
If the nmon author is interested, please contact me!
Hi,
My current thoughts are to add this to njmon for Linux for flexibility reason due to its JSON format.
Too busy recently and at the moment but likely to change after next weeks conference in Atlanta, USA.
Cheers, Nigel
Francesco,
As you state in your own project monitoring cgroups is a complex area.
I think I will leave it out of nmon.