Ah, OK.
In that case, on the container, try:
mount | grep lxcfs
cat /proc/cpuinfo
cat /proc/meminfo
IF you have lxcfs correctly installed and used by the containers (as
shown by mount command), cpuinfo and meminfo should contain
container-specific values as set on cgroups (e.g.
lxc.cgroup.cpuset.cpus, lxc.cgroup.memory.limit_in_bytes)
if you DON'T see lxcfs there, check:
- whether lxcfs is running
- whether lxcfs hook is properly setup (e.g. on Ubuntu lxcfs has
/usr/share/lxc/config/common.conf.d/00-lxcfs.conf, and
/usr/share/lxc/config/common.conf includes
/usr/share/lxc/config/common.conf.d/)
--
Fajar
Post by Fırat KÃÃÃKin fact.
Today i setup lxd and lxc seperately.
lxc config set my-container limits.memory 4G
and it worked.
But i considered lxd is not quite stable for production. Than i used lxc
then i created a container and edit conf-file
lxc.cgroup.memory.limit_in_bytes = 2048M
but it doesn't work.
In both cases i used free -h or cat /proc/meminfo
Post by Fajar A. NugrahaPost by Fırat KÃÃÃKHi,
lxc.cgroup.memory.limit_in_bytes = 2048M
but my container free -h output shows 32GB
Is there anything that i missed?
Not really.
In most (all?) lxc setup, various tools (e.g. free, top) on the
container will show the host's total resources. You will only see the
limit take effect once you run some memory and cpu-intensive programs.
lxcfs should help in some situations, but not all.
lxc-cgroup -n CONTAINER_NAME memory.limit_in_bytes
lxc-cgroup -n CONTAINER_NAME memory.usage_in_bytes
The second output should always be lower than the first. Once the
container's usage approach the set limit, you'd see OOM-messages on
syslog and programs on the container will be automatically killed
courtesy of OOM killer.
--
Fajar
_______________________________________________
lxc-users mailing list
http://lists.linuxcontainers.org/listinfo/lxc-users
--
FIRAT KÜÇÜK
_______________________________________________
lxc-users mailing list
http://lists.linuxcontainers.org/listinfo/lxc-users