Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Host:

Debian 6.0 (squeeze) with qemu-kvm and libvirt from squeeze-backports

ii qemu-kvm 1.0+dfsg-8~bpo60+1

ii libvirt-bin 0.9.8-2~bpo60+2

Has 3TB sata drives with software raid and lvm. It has a sequential write speed of ~140MB/s measured with dd bs=1M count=512 if=/dev/zero of=test conv=fdatasync

Elevator set to cfq

Guest

Debian 6.0 (squeeze)

Uses LVM as storage. Drivers are virtio and cache='none'

Sequential write speed is considerably slower with only 25-50MB/s

Elevator set to noop

I'm kind of running out of ideas for further tweaks but I'm sure that I/O speed should be much faster because many people are reporting almost native performance with lvm.

share|improve this question
    
Are you using the virtio block driver? –  mgorven Jun 1 '12 at 4:02
    
Ok, something weird happened. I ran those tests again today when I woke up and the difference is noticeable. All squeeze guest are now up to native performance. But one older lenny guest is still having problems - max. 50MB/s. What could be happening? Is it the older kernel? 2.6.26-2-amd64 ... –  Akarot Jun 1 '12 at 11:36
    
I noticed one more thing when looking at 'lspci' output on squeeze and lenny boxes. Squeeze has: SCSI storage controller: Red Hat, Inc Virtio block device | Lenny has: SCSI storage controller: Qumranet, Inc. Device 1001 | ... why is that? Both have virtio enabled.. –  Akarot Jun 1 '12 at 17:19
    
Ah, I found out that qumranet actually is the virtio controler I want. –  Akarot Jun 1 '12 at 17:27

4 Answers 4

Try setting your host's I/O elevator to deadline. Keep the guest at noop.

share|improve this answer
    
It's maybe just a tiny bit better but still nowhere near expectations. –  Akarot Jun 1 '12 at 2:01
up vote 3 down vote accepted

Ok, this has been finally solved. The problem was in partition misalignment. It looks like Debian's default installer (especially lenny?) can't do the alignment properly, because when I checked the partitions it made with parted, it reported misalignment on all of them.

I solved this by manually partitioning LVM with parted prior to installation and now all guests are enjoying full performance.

share|improve this answer
1  
Could you possibly add some more information on what you did here? Misalignment on host or guest? What needed to be done to resolve it? –  El Yobo Jul 15 '12 at 4:59
    
askubuntu.com/questions/8592/… is useful enough; looks like this isn't my problem, although I have much worse performance problems than you did (125MB/s on the host, <1MB/s on the guest). –  El Yobo Jul 15 '12 at 6:20

first of all, try to test the speeds with direct option, to eliminate the possibility of looking at the wrong results. Then, what you describe is something I've seen quite often on Debian and Ubuntu, any chance you can bring up a Fedora or RHEL host and guests to recheck?

share|improve this answer
    
Fedora is unfortunately out of the question because I can't reinstall anymore. Machine is already serving a few sites that need to be online. –  Akarot Jun 1 '12 at 14:54
    
your recent update kinda proved my point :) –  dyasny Jun 1 '12 at 15:16
    
What point? That debian is unpredictable? :) –  Akarot Jun 1 '12 at 15:22
    
that performance can depend on the distro. Problem is - most kvm devs work on fedora, and the rest of the distros take code from it. How well they adapt the code is something that's completely out of anyone's control :) –  dyasny Jun 1 '12 at 16:03

For the best possible speed you should preallocate the image and use the raw format !

http://www.linux-kvm.org/page/Tuning_KVM

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.