OpenVZ Forum


Home » General » Support » Using OpenVZ containers to control cpu for HN processes
Using OpenVZ containers to control cpu for HN processes [message #34971] Sun, 15 February 2009 02:47 Go to next message
bjdea1 is currently offline  bjdea1
Messages: 39
Registered: February 2009
Member
Hi,
I'm not really wanting to setup virtual servers. I am simply wanting to control/limit process cpu allowances on a standard server (non virtual server).

The standard scheduling regimes in Linux fall short when it comes to controlling how much cpu % a process is given.

Can this be achieved with the openVZ kernel? Is there anyway I could run something like:

cpulimit PID 10%

(I don't want to use the cpulimit software as its not true cpu time sharing, it simply sends signals to turn processes on and off. I'm looking for a OpenVZ way of achieving the same thing).

So basically can I use openVZ containers to isolate a process and restrict its cpu usage - while still letting that process be able to access the HN filesystem - like a standard process on a standard server?

Any such response/help would be GREATLY appreciated.

Thanks


Deasoft.com Hosting/Software
AutoBillMe.com Billing Automation

[Updated on: Sun, 15 February 2009 02:49]

Report message to a moderator

Re: Using OpenVZ containers to control cpu for HN processes [message #34972 is a reply to message #34971] Sun, 15 February 2009 09:39 Go to previous messageGo to next message
piavlo is currently offline  piavlo
Messages: 159
Registered: January 2007
Senior Member
1)You can use kernel cpusets
http://www.mjmwired.net/kernel/Documentation/cpusets.txt
a tool that makes use of cpusets easy can be found here -
http://developer.novell.com/wiki/index.php/Cpuset

2) You can use the now default linux CFQ scheduler to schedule
based on control groups using the libcg - http://libcg.sourceforge.net/
The lxc containers project http://lxc.sourceforge.net/ - is utilizing libcg and other recently included in mainline kernel
containerization parts. AFAIU this is the main contributor project whose container implementations are being included the mainline kernel.
Re: Using OpenVZ containers to control cpu for HN processes [message #34973 is a reply to message #34972] Sun, 15 February 2009 10:58 Go to previous messageGo to next message
bjdea1 is currently offline  bjdea1
Messages: 39
Registered: February 2009
Member
Thank you very much for this information, really appreciate it.

Control groups looks like exactly what I'm wanting.

But I have done so much searching for any kind of guide on how to activate cgroups.

Am I correct in assuming its a kernel patch and needs to be added at compile time? Or can it be added as a module? Or is it already in the latest kernel?

How do I know if I have it and how do I set it up?

I have the latest kernel, how do I active cgroups?


Deasoft.com Hosting/Software
AutoBillMe.com Billing Automation

[Updated on: Sun, 15 February 2009 11:02]

Report message to a moderator

Re: Using OpenVZ containers to control cpu for HN processes [message #34974 is a reply to message #34973] Sun, 15 February 2009 11:11 Go to previous messageGo to next message
bjdea1 is currently offline  bjdea1
Messages: 39
Registered: February 2009
Member
Actually I think I just found out why I couldn't get it working.

I didn't select it during kernel compile time, wooops Smile

I am compiling a new kernel now, see how it goes.


Deasoft.com Hosting/Software
AutoBillMe.com Billing Automation
Re: Using OpenVZ containers to control cpu for HN processes [message #34975 is a reply to message #34974] Sun, 15 February 2009 13:10 Go to previous message
bjdea1 is currently offline  bjdea1
Messages: 39
Registered: February 2009
Member
Ok it is working now.

Thank you very much for pointing me in the right direction.


Deasoft.com Hosting/Software
AutoBillMe.com Billing Automation
Previous Topic: kernel 2.6.18 and binfmt_misc (even unloaded) => kernel panic
Next Topic: touchvps experiences
Goto Forum:
  


Current Time: Thu Apr 25 04:32:13 GMT 2024

Total time taken to generate the page: 0.01443 seconds