OpenVZ Forum


Home » General » Support » *SOLVED* Limit the VE number of processor usage
*SOLVED* Limit the VE number of processor usage [message #14028] Tue, 12 June 2007 11:12 Go to next message
jmslkn is currently offline  jmslkn
Messages: 19
Registered: June 2007
Junior Member
Is there any way to limit the number of processor associated to a VE? Eg.: processor1 used by VE101 50%, VE102 50%; processor2 used by ve110 100%.

Regards.
J.

[Updated on: Thu, 14 June 2007 09:54] by Moderator

Report message to a moderator

Re: Limit the VE number of processor usage [message #14030 is a reply to message #14028] Tue, 12 June 2007 11:42 Go to previous messageGo to next message
ugob is currently offline  ugob
Messages: 271
Registered: March 2007
Senior Member
[root@server dump]# vzcpucheck
Current CPU utilization: 278775
Power of the node: 445874

[root@server dump]# grep CPU /etc/vz/conf/101.conf
CPUUNITS="51125"



Please read the manual before asking questions:
http://download.openvz.org/doc/OpenVZ-Users-Guide.pdf

Please have a look at the wiki before asking questions:
http://wiki.openvz.org/Main_Page
Re: Limit the VE number of processor usage [message #14031 is a reply to message #14028] Tue, 12 June 2007 11:51 Go to previous messageGo to next message
rickb is currently offline  rickb
Messages: 368
Registered: October 2006
Senior Member
On a SMP kernel, this is not possible.

OpenVZ distributes/limits according to cputime only. Openvz does not allow you to control which cpu the cputime is spent on.


-------------
Common Terms I post with: http://wiki.openvz.org/Category:Definitions

UBC. Learn it, love it, live it: http://wiki.openvz.org/Proc/user_beancounters
Re: Limit the VE number of processor usage [message #14032 is a reply to message #14031] Tue, 12 June 2007 12:07 Go to previous messageGo to next message
jmslkn is currently offline  jmslkn
Messages: 19
Registered: June 2007
Junior Member
Thanks for the answer. However I have found a standard tool (taskset) which can modify the processor affinity mask for a task. [1] [2]

It is possible to change the VE init process CPU affinity mask? As far as I know the affinity mask inherinted from the parent process. The OpenVZ cputime counter prepared for these kinds of affinity modifications?

Thanks,
J.

[1] http://www.linuxcommand.org/man_pages/taskset1.html
[2] http://en.wikipedia.org/wiki/Affinity_mask
Re: Limit the VE number of processor usage [message #14033 is a reply to message #14032] Tue, 12 June 2007 12:14 Go to previous messageGo to next message
rickb is currently offline  rickb
Messages: 368
Registered: October 2006
Senior Member
In that case, yes you can request a set of processes to be restricted to a specific set of cpus. I am not sure how this will effect performance but I am assuming you are not looking for an overall gain, more like extreme fairness control. Download the openvz patch and towards the beginning there is a few paragraphs on the 2nd level cpu scheduler. This will illustrate how openvz selects a process and decides which physical cpu it gets run on. The final choice is made with the normal scheduler, which is where processor affinity would take effect.



-------------
Common Terms I post with: http://wiki.openvz.org/Category:Definitions

UBC. Learn it, love it, live it: http://wiki.openvz.org/Proc/user_beancounters
Re: Limit the VE number of processor usage [message #14077 is a reply to message #14028] Thu, 14 June 2007 09:53 Go to previous messageGo to next message
Vasily Tarasov is currently offline  Vasily Tarasov
Messages: 1345
Registered: January 2006
Senior Member
Hello,

you can set the number of available CPUs in VE by --cpus command:

# vzctl set <veid> --cpus 1

HTH,
Vasily.
Re: Limit the VE number of processor usage [message #14090 is a reply to message #14077] Thu, 14 June 2007 14:25 Go to previous message
rickb is currently offline  rickb
Messages: 368
Registered: October 2006
Senior Member
yes, I believe he knew about that as its in the man page. what he wants to do is bind VEs to specific CPU(s). solaris supports this, I don't really know how useful it is unless you have some massive mainframe where you want better isolation.



-------------
Common Terms I post with: http://wiki.openvz.org/Category:Definitions

UBC. Learn it, love it, live it: http://wiki.openvz.org/Proc/user_beancounters
Previous Topic: *SOLVED* Kernel crash
Next Topic: *SOLVED* setup openvpn
Goto Forum:
  


Current Time: Sun Jul 14 14:02:14 GMT 2024

Total time taken to generate the page: 0.02339 seconds