On 06/29/2011 07:20 AM, Michal Hocko wrote:
> Hi,
>
> On Thu 23-06-11 19:10:39, Kevin Constantine wrote:
>> On 06/23/2011 05:51 PM, Balbir Singh wrote:
>>> If you don't mind, can I ask how you are using libcgroup, what is the use 
>>> case?
>>>
>>
>> We're using cgroups in our render environment to pin batch jobs and
>> their child processes to individual cpu's to avoid processes hopping
>> around to different cores and flushing their caches.  Basically each
>> batch job gets its own cgroup with the cpuset controller and we allocate
>> a single cpu to that cgroup.
>>
>> We're also using them to run batch jobs on our interactive workstations
>> without impacting the end user.  We're carving off a few cores and a few
>> GB's of RAM from each workstation to run batch jobs on throughout the day.
>>
>> Basically the batch scheduler is dynamically creating and destroying
>> cgroups pretty regularly.  I wrote code to do all of that and then
>> realized that libcgroup exists, so now I'm going back through and
>> refactoring to use the api as much as possible.
>
> I am wondering why you need to write any code for that. Isn't cgred
> (man cgrules.conf) what you need?
>

I think cgred makes sense for managing machines where I know what kind 
of workload to expect.  My understanding of it is that cgroups are 
created ahead of time with cgconfig.conf and then the rules map 
processes into those cgroups.

The problem is that I have no idea what kind of workload to expect on 
most of these machines.  The processes could be named just about 
anything, and they could come from just about any user.

I could set up a config so that anything that gets run from the 
scheduler's client daemon process lands in a cgroup.  But then we run 
into the situation where I want each batch process to live in its own 
cgroup and have one or more cpu's pinned to that cgroup (depending on 
how many cpu's the job asks for).  I'm not sure how to configure 
something dynamic like that with these rules.

It seems easier to add cgroup functionality to the scheduler than it 
does to come up with some configuration management scheme for creating 
and maintaining cgrules.conf files all over the place.

cgconfig/cgred feels like something that you'd set up and kind of forget 
about on a server where I've got an ftp service and an email service and 
want to keep them in resource boxes.  In our environment, rules might 
change depending on what time of day it is.  For example, at night the 
memory and number of cpus allocated to batch jobs on a machine might get 
increased since there's very little interactive work happening.

-kevin

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Libcg-devel mailing list
Libcg-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libcg-devel

Reply via email to