[virt-tools-list] [libvirt] cpulimit and kvm process

Richard W.M. Jones rjones at redhat.com
Fri Oct 1 12:15:33 UTC 2010


On Fri, Oct 01, 2010 at 10:03:28AM +0300, Mihamina Rakotomandimby wrote:
> Manao ahoana, Hello, Bonjour,
> 
> I would like to launch several KVM guests on a multicore CPU.
> The number of the KVM process is over the number of physical cores.
> 
> I would like to limit each KVM process to say... 10% of CPU
> 
> I first use "cpulimit "
> 
> Would you know some better way to limit them? it's in order to avoid 4
> VM to hog all the 4 hardware cores.

KVM processes are just like Linux processes, so you can pin them and
renice them.

There is support for pinning virtual CPUs to physical CPUs in libvirt,
eg:

  virsh vcpupin GuestName 0 0

but you can also use Linux tools.  "tuna" is one such program which I
think is in Fedora, or upstream here:

  http://git.kernel.org/?p=linux/kernel/git/acme/tuna.git;a=summary

Another tool is "renice".

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine.  Supports Linux and Windows.
http://et.redhat.com/~rjones/virt-df/




More information about the virt-tools-list mailing list