OpenVZ Forum


Home » General » Support » limiting cpu core number
limiting cpu core number [message #39206] Sun, 28 March 2010 10:56 Go to next message
jevelyt is currently offline  jevelyt
Messages: 19
Registered: January 2009
Junior Member
Hello,

I have 8 cores CPU. When i create container everybody are getting all 8 cores. Is there any way to limit cpu core number? For example instead of giving 8 x 10% (8 cores cpu and 10% per core) give 4 x 20% or 1 core with 80% CPU?

Thank you.
Re: limiting cpu core number [message #39284 is a reply to message #39206] Sat, 03 April 2010 13:23 Go to previous messageGo to next message
jevelyt is currently offline  jevelyt
Messages: 19
Registered: January 2009
Junior Member
Any suggestions?
Re: limiting cpu core number [message #39312 is a reply to message #39206] Sun, 04 April 2010 15:48 Go to previous messageGo to next message
curx
Messages: 739
Registered: February 2006
Location: Nürnberg, Germany
Senior Member

see man page vzctl:

options:

cpuunits
cpulimit
cpus

Bye,
Thorsten
Re: limiting cpu core number [message #39341 is a reply to message #39206] Wed, 07 April 2010 14:34 Go to previous message
jevelyt is currently offline  jevelyt
Messages: 19
Registered: January 2009
Junior Member
Thank you very much Smile

One more interesting question:

For example we have 8 cores CPU and we start 1 process which eats 50% of 1 core CPU (when we look through - htop) and other 7 cores eats ~0-2%.
If we will limit cpu cores to 4, the Mhz per core will double and we will get increase in performance for that process i.e. there will be 4 cores and that process will eat not 50%, but ~25% theoretically? I'm right or no?
It's interesting because there are a lot of processes which don't support multicore and it will be better if we will limit cores for ex. to 1 to get improvement in performance.
Thank you.

[Updated on: Wed, 07 April 2010 14:36]

Report message to a moderator

Previous Topic: init process has other than root group ID
Next Topic: Container start failure when ipv6 is disabled
Goto Forum:
  


Current Time: Mon Nov 18 16:24:53 GMT 2024

Total time taken to generate the page: 0.02870 seconds