[lxc-users] memory limits

Mohan G mohan_gg at yahoo.com
Tue Apr 14 11:10:00 UTC 2015


Hi,Regarding the same thread, can 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.
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/ea08d5b2/attachment.html>


More information about the lxc-users mailing list