[lug] kvm drive i/o - nfs vs direct mount

David Ahern dsahern at gmail.com
Tue Apr 5 15:53:16 MDT 2011



On 04/05/11 15:33, Michael J. Hammel wrote:
> I'm running an Ubuntu 9.10 image under KVM on F13.  I mount a directory
> in the guest from the host via NFS and perform builds from the guest on
> that mounted directory.  Performance is very bad.  Unpacking the Linux
> kernel source takes over an hour.

I regularly do kernel builds within VMs with the source in an NFS mount
from the host. I have not had any issues with performance.

Are you using virtio for networking? What kind of CPU do you have for
the host?

Any idea where the slowdown is? try running 'perf top' in both.

David

> 
> Is there a way to mount the host's disk directly into the guest?  I've
> tried the following snippet in the /etc/libvirt/qemu/<image>.xml but it
> doesn't appear to show up when the guest is running:
> 
> <disk type='block' device='disk'>
>   <source dev='/dev/sdb1'/>
>   <target dev='vdb' bus='scsi'/>
> </disk>
> 
> The drive is a SATA drive at /dev/sdb that is currently mounted on the
> host as /home2 for the ext4 partition on /dev/sdb1.  I also tried a
> source dev of "/dev/sdb" in the xml but that didn't change anything.
> 
> Barring being able to directly access the drive/partition on the host
> from the guest to improve disk i/o performance for the guest, does
> anyone have any suggestions on how to improve NFS and/or network
> performance of the guest?



More information about the LUG mailing list