Skip to contentSkip to conversation

Question about limiting KVM cpu usage

DISCUSSION Steve Lorimer 3 participants 3 messages Sep 11, 2008 KVM

lore
Share & tools
lore
#0 lore raw

Hello, all,
I have what should be a simple question concerning KVM. Is there a
way to limit cpu usage for a KVM guest? In other words, if I am running four guest servers and something on one of them begins to use a ton of cpu, I don't really want it to slow down all the others. Is the only way to do this by limiting it to one cpu core? Granted, I would prefer that it have access to full computing power if no other guest needs it. Thanks for any advice.

Steve Lorimer <slorimer a t kmbc.edu

#1 lore raw

2008/9/11 Steve Lorimer <[email protected]>:

Quoted 7 lines

Hello, all,
I have what should be a simple question concerning KVM. Is there a way to
limit cpu usage for a KVM guest? In other words, if I am running four guest servers and something on one of them begins to use a ton of cpu, I don't really want it to slow down all the others. Is the only way to do this by limiting it to one cpu core? Granted, I would prefer that it have access to full computing power if no other guest needs it. Thanks for any advice.

You can use standard linux process utilities. Check out nice, ionice and taskset.

nice to set process priority
ionice to set I/O priority
taskset to set CPU affinity

#2 lore raw
Quoted 11 lines · FinnTux

2008/9/11 Steve Lorimer <[email protected]>:

Quoted 7 lines

Hello, all,
I have what should be a simple question concerning KVM. Is there a way to
limit cpu usage for a KVM guest? In other words, if I am running four guest servers and something on one of them begins to use a ton of cpu, I don't really want it to slow down all the others. Is the only way to do this by limiting it to one cpu core? Granted, I would prefer that it have access to full computing power if no other guest needs it. Thanks for any advice.

You can use standard linux process utilities. Check out nice, ionice and taskset.

I think 'cpulimit' is what you really need.

Cristi

Signature · 4 lines
Ing. Cristi Măgherușan,
Universitatea Tehnică din Cluj-Napoca
Centrul de Comunicații "Pusztai Kalman"
Tel. 0264/401247  http://cc.utcluj.ro