<div dir="ltr"><div><div><div><div><div><div><div>in fact.<br><br></div>Today i setup lxd and lxc seperately.<br><br></div>on lxd setup i used:<br><br>lxc config set my-container limits.memory 4G<br><br></div>and it worked.<br><br></div>But i considered lxd is not quite stable for production. Than i used lxc<br></div>then i created a container and edit conf-file<br><br>lxc.cgroup.memory.limit_in_bytes = 2048M<br><br></div>but it doesn't work.<br><br></div>In both cases i used free -h or cat /proc/meminfo<br><div><div><div><div><div><div><br><br></div></div></div></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-04-29 11:09 GMT+03:00 Fajar A. Nugraha <span dir="ltr"><<a href="mailto:list@fajar.net" target="_blank">list@fajar.net</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Wed, Apr 29, 2015 at 2:17 PM, Fırat KÜÇÜK <<a href="mailto:firatkucuk@gmail.com">firatkucuk@gmail.com</a>> wrote:<br>
> Hi,<br>
><br>
> i updated the config file:<br>
> lxc.cgroup.memory.limit_in_bytes = 2048M<br>
><br>
> but my container free -h output shows 32GB<br>
><br>
> Is there anything that i missed?<br>
<br>
</div></div>Not really.<br>
<br>
In most (all?) lxc setup, various tools (e.g. free, top) on the<br>
container will show the host's total resources. You will only see the<br>
limit take effect once you run some memory and cpu-intensive programs.<br>
lxcfs should help in some situations, but not all.<br>
<br>
>From the host, run:<br>
<br>
lxc-cgroup -n CONTAINER_NAME memory.limit_in_bytes<br>
lxc-cgroup -n CONTAINER_NAME memory.usage_in_bytes<br>
<br>
The second output should always be lower than the first. Once the<br>
container's usage approach the set limit, you'd see OOM-messages on<br>
syslog and programs on the container will be automatically killed<br>
courtesy of OOM killer.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Fajar<br>
</font></span><div class="HOEnZb"><div class="h5">_______________________________________________<br>
lxc-users mailing list<br>
<a href="mailto:lxc-users@lists.linuxcontainers.org">lxc-users@lists.linuxcontainers.org</a><br>
<a href="http://lists.linuxcontainers.org/listinfo/lxc-users" target="_blank">http://lists.linuxcontainers.org/listinfo/lxc-users</a></div></div></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature">FIRAT KÜÇÜK</div>
</div>