From: "Daniel P. Berrange" <berrange@redhat.com>
To: Thomas Fjellstrom <thomas@fjellstrom.ca>
Cc: Avi Kivity <avi@redhat.com>, kvm@vger.kernel.org
Subject: Re: How many threads should a kvm vm be starting?
Date: Wed, 28 Sep 2011 08:41:19 +0100 [thread overview]
Message-ID: <20110928074119.GB21102@redhat.com> (raw)
In-Reply-To: <201109271604.41502.thomas@fjellstrom.ca>
On Tue, Sep 27, 2011 at 04:04:41PM -0600, Thomas Fjellstrom wrote:
> On September 27, 2011, Avi Kivity wrote:
> > On 09/27/2011 03:29 AM, Thomas Fjellstrom wrote:
> > > I just noticed something interesting, a virtual machine on one of my
> > > servers seems to have 69 threads (including the main thread). Other
> > > guests on the machine only have a couple threads.
> > >
> > > Is this normal? or has something gone horribly wrong?
> >
> > It's normal if the guest does a lot of I/O. The thread count should go
> > down when the guest idles.
>
> Ah, that would make sense. Though it kind of defeats assigning a vm a single
> cpu/core. A single VM can now DOS an entire multi-core-cpu server. It pretty
> much pegged my dual core (with HT) server for a couple hours.
You can mitigate these problems by putting each KVM process in its own
cgroup, and using the 'cpu_shares' tunable to ensure that each KVM
process gets the same relative ratio of CPU time, regardless of how
many threads it is running. With newer kernels there are other CPU
tunables for placing hard caps on CPU utilization of the process as
a whole too.
Regards,
Daniel
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
next prev parent reply other threads:[~2011-09-28 7:41 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-27 0:29 How many threads should a kvm vm be starting? Thomas Fjellstrom
2011-09-27 6:33 ` Avi Kivity
2011-09-27 22:04 ` Thomas Fjellstrom
2011-09-28 7:41 ` Daniel P. Berrange [this message]
2011-09-28 7:55 ` Thomas Fjellstrom
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=20110928074119.GB21102@redhat.com \
--to=berrange@redhat.com \
--cc=avi@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=thomas@fjellstrom.ca \
/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