[lxc-users] lxc memory limit doesn't work

Fırat KÜÇÜK firatkucuk at gmail.com
Wed Apr 29 09:09:10 UTC 2015


in fact.

Today i setup lxd and lxc seperately.

on lxd setup i used:

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



2015-04-29 11:09 GMT+03:00 Fajar A. Nugraha <list at fajar.net>:

> On Wed, Apr 29, 2015 at 2:17 PM, Fırat KÜÇÜK <firatkucuk at gmail.com> wrote:
> > Hi,
> >
> > i updated the config file:
> > 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.
>
> From the host, run:
>
> 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
> lxc-users at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-users
>



-- 
FIRAT KÜÇÜK
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20150429/31815566/attachment.html>


More information about the lxc-users mailing list