i have centOS dedicated server and installing vmware server how i can limit cpu/resource usage for each vm ? its very big problem my XEON server are overload..
5 Answers
A Simple Way:
CPU:
I would recommend setting the 'niceness' of the each process that corresponds to the VM. This doesn't really limit how much CPU is used, but rather sets the priority that the scheduler will give it.
You can change the priority of a process with the renice command. -20 is the highest priority, 20 is the lowest priority:
renice 10 -p 12345 #Where 12345 is the pid of the vmware process for the vm you want to limit.
To increase the priority, The command may need to be run as the superuser.
Memory:
The amount of Memory a VM gets is set with the VM properties inside of VMware Server, I would start with that.
Disk:
Disk IO can be one of the problems with VMs. You can get some number of disk performance with the iostat command which is part of the sysstat package. You can then use the ionice to change the disk priority. For example, to set a vm to 'idle' disk priority:
ionice -c3 -p12345
A Little More Complicated:
You could run the VMs as a specified user, and use PAM and the /etc/security/limits.conf to limit the resources run by the user.

- 83,619
- 74
- 305
- 448
-
Also found a post that say you can accomplish the nice levels in a he vmx config file with vmx.threadPriority = "-4" and aioMgr.threadPriority = "-4" , but I have never tried that myself. – Kyle Brandt Aug 18 '09 at 11:38
I'm not sure if vmware server can do it, but if you install ESXi (free) then you can limit the CPU usage per vm. Note, this will overwrite the entire system, effectively giving you a dedicated vmware device.

- 63
- 5
There is no way that I know of, aside form limiting each VM to one vCPU which is the default, of throttling CPU use per VM in VMWare Server.
You might find such features in the "bare metal" VM solution (ESX) or its free equivalent ESXi.

- 22,754
- 45
- 67
I'm 99% sure there is no resource control in regular Server, there's loads in ESX though but that's no use to you.

- 101,299
- 9
- 108
- 239