Hi all,

i'm going to use LXC as a lightweight instrument to partition a modern equipped 
blade server center into discrete, handy units to run a set of business 
applications in it. Because it's a "friendly environment", I don't have to 
focus on jail security. But I want to use the features of the cgroup systems to 
assign a dedicated amount of different resources to the containers to minimize 
the impact of a "misbehaving" application to the others.

Therefore, I want to assign the number of cpu cores as well as the amount of 
usable memory. But in opposite to the cgroup memory subsystem, where I operate 
with the amount of memory by the abstract number of bytes, within the cgroup 
cpuset subsystem I have to deal with a concrete list of cores. 

That is a concern I don't want to deal with while configuring a container 
setup, because as like as for the memory I want to define here just the amount 
of cpu power, i.e. the number of cores. But the current API for "cpuset.cpus" 
don't offer any support for this, e.g. a syntax to claim the "next n free 
cores".

As a proof of concept to deal with this, I've start to develop an external 
script to run on a lxc host. By each run it will balance out the reserved cores 
of all containers: The number of assigned cores is kept, but they are spread 
round-robin of the available cores of the host. Using this script, I just have 
to configure the number of cores for my LXC container configuration files 
(lxc.cgroup.cpuset.cpus = 0-<n-1>). And after startup (or shutdown) of a (set 
of) container(s) on a specific blade host, I let it re-assign the concrete used 
cores. 


I'll attached my alpha version of a script. The next todo is (instead of just 
incrementing the core number) to introduce an "precedence table" for the cores 
to respect the technical concerns like real cores vs. hypertheating or the 
impacts of a NUMA architecture. This might be constructed by sorting the 
information of /proc/cpuinfo in a appropriate way. Another one is to support 
the "exclusive cpu" setting.

But any other comments on this are welcome. To the LXC maintainers: Might this 
be bundled with the LXC distribution in spite of it's not realy restricted to 
LXC? Should it be rewritten in perl because most of the other work is done 
using this language?


with greetings

Guido

Attachment: balance-cpus
Description: balance-cpus

------------------------------------------------------------------------------
What Every C/C++ and Fortran developer Should Know!
Read this article and learn how Intel has extended the reach of its 
next-generation tools to help Windows* and Linux* C/C++ and Fortran 
developers boost performance applications - including clusters. 
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
Lxc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/lxc-users

Reply via email to