[lxc-users] Getting information about memory and cpu resources of an LXC container

David Shwatrz dshwatrz at gmail.com
Tue Mar 25 12:42:12 UTC 2014


Hi,

I hade added a limit of 512 M and using only CPU #0 in an LXC container
config file:
lxc.cgroup.memory.limit_in_bytes = 512M
lxc.cgroup.cpuset.cpus = 0

Now, from within the container, cat /proc/meminfo and cat
/proc/cpuinfo, as well as free(), will
show infromation about the host, not about the container.

Is the only way to retrieve that information about the memory assigned to
a container and the CPU(s) assigned to it, from within the container, is by:

cat  /sys/fs/cgroup/memory/lxc/fedora/memory.limit_in_bytes

and
cat   /sys/fs/cgroup/cpuset/lxc/fedora/cpuset.cpus

Or is some other way to get that information ?

BR,
DavidSD


More information about the lxc-users mailing list