<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px"><div dir="ltr" id="yui_3_16_0_1_1428661800359_81749"><span>Hi.</span></div><div dir="ltr" id="yui_3_16_0_1_1428661800359_81747"><span id="yui_3_16_0_1_1428661800359_81746">My dilemma is that i have one cgroup in the system which is running file work load and there are other applications running natively on the system without any cgroups. But when cgroups have set some memory configured, it should be honoured or given preference.</span></div><div dir="ltr" id="yui_3_16_0_1_1428661800359_81744"><span id="yui_3_16_0_1_1428661800359_81743">Like in case the shrinker kicks in as part of system pressure, the cgroup that i have created should be the last one to be reclaimed or no reclaim at all, until the soft limits of the cgroups are beached. Are there any such schema.</span></div><div dir="ltr" id="yui_3_16_0_1_1428661800359_81741"><span><br></span></div><div dir="ltr" id="yui_3_16_0_1_1428661800359_81769"><span>Regards</span></div><div dir="ltr" id="yui_3_16_0_1_1428661800359_81739"><span>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_81663"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;" id="yui_3_16_0_1_1428661800359_81662"> <div dir="ltr" id="yui_3_16_0_1_1428661800359_81661"> <hr size="1" id="yui_3_16_0_1_1428661800359_81788"> <font size="2" face="Arial" id="yui_3_16_0_1_1428661800359_81665"> <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_81667"><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>