All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Erik Brakkee <erik@brakkee.org>
Cc: kvm@vger.kernel.org
Subject: Re: Workload spikes on KVM host when doing IO on a guest...
Date: Sun, 20 May 2012 16:54:48 +0300	[thread overview]
Message-ID: <4FB8F7A8.5050504@redhat.com> (raw)
In-Reply-To: <4FB84114.1090600@brakkee.org>

On 05/20/2012 03:55 AM, Erik Brakkee wrote:
> Hi,
>
>
> I am seeing high workload spikes of approx. 15 when I do IO inside a
> KVM guest, for instance
>
>   dd if=/dev/zero bs=1G count=1 of=hog
>
> When I execute a similar command on the host to write a file on the
> same physical disk, the workload only goes to about 3.

This is not surprising.  Each I/O request executes in a thread.

>
> I am using virtio on the guest with cache mode none. Also, I am using
> the noop IO scheduler on the guest and the deadline IO scheduler on
> the host.
> The guest is allocated a logical volume from the host.
>

With logical volumes, you can use -drive ...,aio=native to avoid the
threads.  The load will disappear.

> When I execute the dd command on the guest, it finishes almost
> instantaneously but when I execute it on the host I have to wait for
> approx 10 seconds. Specifically,
> on the guest I see a transfer speed of approx. 600 MB/s and on the
> host I get 75.9MB/s. The figure for the host is most reliable as this
> is close to what the hard disks can handle (WD enterprise class SATA
> hard disks).

try dd oflag=direct to force the data to disk.  No idea why the host
doesn't finish instantaneously.

>
> What appears to be happening is that somehow it forwards all IO from
> the guest immediately to the host, just as if write back caching was
> used.

Write back caching is indeed used, since you did not specify oflag=direct.

> Is this some known issue in this version of KVM and should I simply
> upgrade (or replace the host with a centos 6.2 system). Or is there a
> simple configuration that can fix this?

Nothing is broken, so it doesn't need fixing.  The high load is not an
indication of anything.

-- 
error compiling committee.c: too many arguments to function


  reply	other threads:[~2012-05-20 13:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-20  0:55 Workload spikes on KVM host when doing IO on a guest Erik Brakkee
2012-05-20 13:54 ` Avi Kivity [this message]
     [not found]   ` <4FB923BB.9070306@brakkee.org>
     [not found]     ` <4FB924D0.1020704@redhat.com>
     [not found]       ` <4FB929DE.8000500@brakkee.org>
2012-05-20 17:49         ` Avi Kivity
2013-04-03 20:19           ` Erik Brakkee

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=4FB8F7A8.5050504@redhat.com \
    --to=avi@redhat.com \
    --cc=erik@brakkee.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.