Web lists-archives.com

Re: virtual disks perfermonca <=2MB/s

Why are you using vhd instead of qcow2? I would wager it's a combination of the vhd format having some bug. Try with qcow2 first.

On 22 February 2017 at 21:17, Mimiko <vbvbrj@xxxxxxxxx> wrote:

I already wrote to qemu mail list and didn't find an answer.

I've setup qemu / kvm on Debian Wheezy to host some Debian Jessie guests.
I create disk like this:

virsh vol-create-as --pool default --name root.vhd --capacity 50G --format vpc

Then create a virtual with this:
virt-install --connect qemu:///system \
--ram 2048 \
--vcpus=4 \
--cpuset=auto \
--pxe \
--os-type linux \
--boot network,hd,menu=on \
--disk vol=default/root.vhd,device=disk,bus=virtio,cache=writethrough \
--network=bridge:br0,model=virtio \
--noautoconsole \
--hvm \
--autostart \

After setting up the system I've got poor disk performance.

time dd if=/dev/zero of=/tmp/test oflag=direct bs=64k count=16000

I get 1048576000 bytes (1.0 GB) copied, 397.473 s, 2.6 MB/s

I've changed cache to writeback and got 20MB/s with this test. But copying a file to this virtual using samba gives me no more of 2 MB/s.

I've tested network connectivity with iperf and got around 750Mbit/s, which I think is satisfactory.

I will not want to use raw devices, as it is not self expanded and will use whole space regardless of how much real data occupy.

libvirtd (libvirt)

Is there a way to increase disk speed to at least 50MB/s ?

As suggested by other to test:

I've created a raw disk of 10GB and attached to VM and mounted it. The speed is same - 2MB.
As per same cifs/samba access to / on the host - the speed is 180MB+, as there are 2 network interfaces in alb bond.

> time dd if=/dev/zero of=/vdisks/test oflag=direct bs=64k count=16000
16000+0 records in
16000+0 records out
1048576000 bytes (1.0 GB) copied, 0.970587 s, 1.1 GB/s

real    0m0.972s
user    0m0.008s
sys     0m0.856s

/vdisks reside on a raidz2 zfs pool via PCI-E hardware raid used in IT mode to allow ZFS software raid.

> /usr/bin/kvm --version
QEMU emulator version 1.1.2 (qemu-kvm-1.1.2+dfsg-6+deb7u19, Debian), Copyright (c) 2003-2008 Fabrice Bellard

> virsh dumpxml YOURVMNAME > tmp.xml
<domain type='kvm' id='10'>
  <memory unit='KiB'>2097152</memory>
  <currentMemory unit='KiB'>2097152</currentMemory>
  <vcpu placement='static'>4</vcpu>
    <type arch='x86_64' machine='pc-1.1'>hvm</type>
    <boot dev='hd'/>
    <boot dev='network'/>
    <bootmenu enable='yes'/>
  <clock offset='utc'/>
    <disk type='file' device='disk'>
      <driver name='qemu' type='vpc' cache='writeback'/>
      <source file='/vdisks/root.vhd'/>
      <target dev='vda' bus='virtio'/>
      <alias name='virtio-disk0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    <controller type='usb' index='0'>
      <alias name='usb0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
    <interface type='bridge'>
      <mac address='52:54:00:de:83:2d'/>
      <source bridge='br0'/>
      <target dev='vnet0'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    <serial type='pty'>
      <source path='/dev/pts/4'/>
      <target port='0'/>
      <alias name='serial0'/>
    <console type='pty' tty='/dev/pts/4'>
      <source path='/dev/pts/4'/>
      <target type='serial' port='0'/>
      <alias name='serial0'/>
    <input type='mouse' bus='ps2'/>
    <graphics type='vnc' port='59081' autoport='no' listen=''>
      <listen type='address' address=''/>
      <model type='cirrus' vram='9216' heads='1'/>
      <alias name='video0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    <memballoon model='virtio'>
      <alias name='balloon0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
  <seclabel type='none'/>

Any help please.