kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Srivatsa Vaddagiri <vatsa@in.ibm.com>
To: Boris Dolgov <boris@dolgov.name>
Cc: kvm@vger.kernel.org, bharata@in.ibm.com,
	Balbir Singh <balbir@in.ibm.com>
Subject: Re: Fwd: KVM and cpu limiting
Date: Fri, 2 Jul 2010 13:27:58 +0530	[thread overview]
Message-ID: <20100702075758.GH12818@linux.vnet.ibm.com> (raw)
In-Reply-To: <AANLkTinbGi6LOu01xySOiqfml-VFG5TYt7ovXVn7hVlR@mail.gmail.com>

> Is it possible to limit cpu usage be VM when using qemu+kvm?

Have you checked cpu controller?

	# mkdir /cpu_control
	# mount -t cgroup -o cpu none /cpu_control

	# cd /cpu_control
	# mkdir vm1
	# mkdir vm2

Then change vm{1,2}/cpu.shares to control how much proportion of CPU capacity
each VM gets. Basically, each vm is (soft-)limtied to:

	its allocated shares / total shares allocated for all VMs.

> I need one server to run a lot of VMs (much more than cpu cores I
> have). Each VM must have it's guaranted cpu time or time slice it must
> use.

This interface is more focused on limiting resource consumption rather than
guaranteeing certain minimum. By carefully controlling how many VMs are run on
the server and how many shares are allocated to each, this can be a good
alternative to provide some "minimum" resources to a VM. Its slightly inflexible
for guaranteeing "minimum" resource to a VM, but that's the best we have now.

> Is it possible to make such limits? Is it possible to modify
> /proc/cpuinfo of VMs?

Why do you want to modify /proc/cpuinfo of VMs?

- vatsa

  parent reply	other threads:[~2010-07-02  7:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-02  6:23 KVM and cpu limiting Boris Dolgov
     [not found] ` <AANLkTinbGi6LOu01xySOiqfml-VFG5TYt7ovXVn7hVlR@mail.gmail.com>
2010-07-02  7:57   ` Srivatsa Vaddagiri [this message]
2010-07-02 16:38     ` Fwd: " Boris Dolgov
2010-07-06  4:39       ` Srivatsa Vaddagiri
2010-07-02  8:02 ` RW

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100702075758.GH12818@linux.vnet.ibm.com \
    --to=vatsa@in.ibm.com \
    --cc=balbir@in.ibm.com \
    --cc=bharata@in.ibm.com \
    --cc=boris@dolgov.name \
    --cc=kvm@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).