On 01/11/2013 01:17 PM, Gary Ballantyne wrote: > Hello All > > I understand that I can limit the RAM of a single container via > lxc.cgroup.memory.limit_in_bytes. But, is there a way to limit the total > RAM available to all containers (without limiting each individually)? > > E.g., say we have 4G available. Rather than specifying a maximum number > of containers (16 with 250M say), I'd like to allocate 4G to all > containers, without a hard upper limit on the number of containers (16 > in this case), and let the performance degrade gradually as more > containers are added. (I'm anticipating being able to use many more > containers this way, since our container's RAM usage is likely to be > bursty).
You can, but not through lxc configuration. LXC uses the "lxc" directory in the cgroup hierarchy, so that your container is typically at: lxc/<container name>/ Manually changing the keys in the lxc directory will set a shared quota for everything under it. As a concrete example, on my laptop, the memory cgroup is mounted at: /sys/fs/cgroup/memory/ And individual container cgroups are at: /sys/fs/cgroup/memory/lxc/<container name> So setting /sys/fs/cgroup/memory/lxc/memory.limit_in_bytes would do what you want. > Many thanks > > Gary > > > ------------------------------------------------------------------------------ > Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and > much more. Get web development skills now with LearnDevNow - > 350+ hours of step-by-step video tutorials by Microsoft MVPs and experts. > SALE $99.99 this month only -- learn more at: > http://p.sf.net/sfu/learnmore_122812 > > > > _______________________________________________ > Lxc-users mailing list > Lxc-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/lxc-users > -- Stéphane Graber Ubuntu developer http://www.ubuntu.com
signature.asc
Description: OpenPGP digital signature
------------------------------------------------------------------------------ Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and much more. Get web development skills now with LearnDevNow - 350+ hours of step-by-step video tutorials by Microsoft MVPs and experts. SALE $99.99 this month only -- learn more at: http://p.sf.net/sfu/learnmore_122812
_______________________________________________ Lxc-users mailing list Lxc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxc-users