<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px"><div id="yui_3_16_0_1_1428661800359_78364" dir="ltr"><span>Hi,</span></div><div id="yui_3_16_0_1_1428661800359_78364" dir="ltr"><span id="yui_3_16_0_1_1428661800359_78378">Regarding the same thread, can </span><span style="font-family: 'Courier New'; white-space: pre-wrap;" class="" id="yui_3_16_0_1_1428661800359_78388">memory.soft_limit_in_bytes be used to guarantee that at least soft limits are honoured or guaranteed to be got by the cgroup, even with heavily contended system wide pressure.</span></div><div id="yui_3_16_0_1_1428661800359_78364" dir="ltr"><span style="font-family: 'Courier New'; white-space: pre-wrap;" class=""><br></span></div><div id="yui_3_16_0_1_1428661800359_78364" dir="ltr"><span style="font-family: 'Courier New'; white-space: pre-wrap;" class="" id="yui_3_16_0_1_1428661800359_78444">Regards</span></div><div id="yui_3_16_0_1_1428661800359_78364" dir="ltr"><span style="font-family: 'Courier New'; white-space: pre-wrap;" class="">Mohan</span></div><br>  <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;" id="yui_3_16_0_1_1428661800359_78382"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;" id="yui_3_16_0_1_1428661800359_78381"> <div dir="ltr" id="yui_3_16_0_1_1428661800359_78380"> <hr size="1">  <font size="2" face="Arial" id="yui_3_16_0_1_1428661800359_78384"> <b><span style="font-weight:bold;">From:</span></b> Fajar A. Nugraha <list@fajar.net><br> <b><span style="font-weight: bold;">To:</span></b> LXC users mailing-list <lxc-users@lists.linuxcontainers.org> <br> <b><span style="font-weight: bold;">Sent:</span></b> Thursday, April 9, 2015 11:11 AM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [lxc-users] memory limits<br> </font> </div> <div class="y_msg_container" id="yui_3_16_0_1_1428661800359_78447"><br>On Thu, Apr 9, 2015 at 11:33 AM, Mohan G <<a shape="rect" ymailto="mailto:mohan_gg@yahoo.com" href="mailto:mohan_gg@yahoo.com">mohan_gg@yahoo.com</a>> wrote:<div class="qtdSeparateBR"><br><br></div><div class="yqt2962700394" id="yqtfd64888"><br clear="none">> Hi,<br clear="none">> query: if i create a cgroup with memory limit of 4GB  and if the system has<br clear="none">> 8GB ram, now if both the system wide pressure is pretty high, does it mean<br clear="none">> it can take away part of this cgroup memory and what if the cgroup now wants<br clear="none">> to run its workloads ?<br clear="none">> My question is whether there is any gurantee that memory limit set on the<br clear="none">> cgroups will be given/reserved to it.</div><br clear="none"><br clear="none">No.<br clear="none"><br clear="none">Your best bet would probably be to limit memory in other cgroups as<br clear="none">well, in a way that the sum of all top-level memory cgroup is below or<br clear="none">equal your total memory. For example, on my ubuntu 14.10, user-started<br clear="none">programs all reside under /user.slice/user-$(id -u).slice, while all<br clear="none">root-started containers lxc is under /lxc. All init-started daemons<br clear="none">(e.g. sshd) does not belong to any cgroup. In that scenario, you<br clear="none">could:<br clear="none">- limit memory use in /lxc to 4G<br clear="none">- limit memory use in /user.slice to use something like 3.5G<br clear="none">- manually move memory-hungry daemons to a new cgroup under<br clear="none">/user.slice (e.g. /user.slice/daemon/mysql). It will then inherit the<br clear="none">limit of its parent cgroup (/user.slice)<br clear="none"><br clear="none">-- <br clear="none">Fajar<br clear="none">_______________________________________________<br clear="none">lxc-users mailing list<br clear="none"><a shape="rect" ymailto="mailto:lxc-users@lists.linuxcontainers.org" href="mailto:lxc-users@lists.linuxcontainers.org">lxc-users@lists.linuxcontainers.org</a><br clear="none"><a shape="rect" href="http://lists.linuxcontainers.org/listinfo/lxc-users" target="_blank">http://lists.linuxcontainers.org/listinfo/lxc-users</a><br><br></div> </div> </div>  </div></body></html>