[lxc-users] memory limits

Mohan G mohan_gg at yahoo.com
Tue Apr 14 12:29:41 UTC 2015


Hi.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.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.
RegardsMohan
      From: Fajar A. Nugraha <list at fajar.net>
 To: LXC users mailing-list <lxc-users at lists.linuxcontainers.org> 
 Sent: Thursday, April 9, 2015 11:11 AM
 Subject: Re: [lxc-users] memory limits
   
On Thu, Apr 9, 2015 at 11:33 AM, Mohan G <mohan_gg at yahoo.com> wrote:


> Hi,
> query: if i create a cgroup with memory limit of 4GB  and if the system has
> 8GB ram, now if both the system wide pressure is pretty high, does it mean
> it can take away part of this cgroup memory and what if the cgroup now wants
> to run its workloads ?
> My question is whether there is any gurantee that memory limit set on the
> cgroups will be given/reserved to it.

No.

Your best bet would probably be to limit memory in other cgroups as
well, in a way that the sum of all top-level memory cgroup is below or
equal your total memory. For example, on my ubuntu 14.10, user-started
programs all reside under /user.slice/user-$(id -u).slice, while all
root-started containers lxc is under /lxc. All init-started daemons
(e.g. sshd) does not belong to any cgroup. In that scenario, you
could:
- limit memory use in /lxc to 4G
- limit memory use in /user.slice to use something like 3.5G
- manually move memory-hungry daemons to a new cgroup under
/user.slice (e.g. /user.slice/daemon/mysql). It will then inherit the
limit of its parent cgroup (/user.slice)

-- 
Fajar
_______________________________________________
lxc-users mailing list
lxc-users at lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-users

  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20150414/6868ad34/attachment.html>


More information about the lxc-users mailing list