Re: IO on guest is 20 times slower than host

Kurt Yoder
2009-03-25T18:52:05Z

On Mar 25, 2009, at 1:55 PM, Avi Kivity wrote:

> Kurt Yoder wrote:
>>
>> What do you mean about the cache? Is my test fundamentally flawed?
>> I *thought* I was testing write speed on the disk...
>
> 'dd', without further arguments, will write to the page cache and
> let the kernel write the data back at a later time. If you increase
> the block size (bs=1M count=1000) you should see much faster times
> on the host, I wouldn't be surprised to see 1GB/s.
>
> If you want to test disk speed, use of=/dev/blah oflag=direct.
> Beware of destroying your data disk.
>

I see. I looked up another test: using hdparm -t. It doesn't show the
situation as quite so bad, but the guest is still a little over half
the speed of the host:

me@host:~$ sudo hdparm -t /dev/mapper/HW_RAID-ROOT

/dev/mapper/HW_RAID-ROOT:
Timing buffered disk reads: 282 MB in 3.00 seconds = 93.92 MB/sec

me@guest:~# hdparm -t /dev/vda

/dev/vda:
Timing buffered disk reads: 156 MB in 3.03 seconds = 51.56 MB/sec

> Something weird is happening with your system. If you extend the
> test, what does 'top' show? On both guest and host.

If I extend the test thusly on the guest:

dd if=/dev/zero of=/bigfile count=10000000

I see 100% CPU utilization on the guest, and 100% CPU utilization on
one of the host cores.