Qcow2

From KVM
Revision as of 08:14, 22 July 2009 by KevinWolf (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Performance status

Growing images (IDE)

An image format like qcow2 has the largest overhead compared to raw images when it needs grow the image, i.e. allocate new clusters. One scenario where you constantly get this worst case is the installation of an OS to an empty qcow2 image. Therefore installations are a good test to see if we get reasonable performance in this case.

The following table shows the installation times for a minimal RHEL 5.3 VM with old and new qcow2 drivers, and for comparison raw images. The installation was done with all three different cache settings. The VMs used IDE disks.

cache = off writethrough writeback
Old qcow2 (0.10.5) 16:52 min 28:58 min 6:02 min
New qcow2 (0.11.0-rc1) 5:44 min 9:18 min 6:11 min
raw 5:41 min 7:24 min 6:03 min

Growing images (virtio)

This is the same test as above, with IDE replaced by virtio.

cache = off writeback
Old qcow2 (0.10.5) 31:09 min 8:00 min
New qcow2 (0.11.0-rc1) 18:35 min 8:41 min
raw 8:48 min 7:51 min

Using allocated images

The above numbers are important for installation and running a freshly installed VM. After a certain time, accesses to the disk only touch already allocated clusters of the disk image.

For the following bonnie++ test results, the disk image have been completely allocated, then an ext2 file system has been created and bonnie++ was run on it. The test was run with the following qemu command line:

$ qemu-system-x86_64 -drive file=systen.img,if=ide -drive file=scratch.qcow2,if=virtio,cache=off -m 768

In the guest:

# dd if=/dev/zero of=/dev/vda bs=1M
# mke2fs /dev/vda
# mount /dev/vda /mnt
# bonnie++ -b -u root -d /mnt

In addition to the qcow2 and raw numbers, both for virtio and IDE, the test results contain a test with qcow2 and IDE in qemu-kvm 0.10.5, referred to as "qcow2 old IDE".

Version 1.03e       ------Sequential Output------ --Sequential Input- --Random-
                    -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine        Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP  /sec %CP
qcow2 IDE     1472M 38232  46 36762   3 16095   4 43605  64 32968   3 112.4   2
qcow2 virtio  1472M 37644  49 37606   3 20626   5 43612  64 46813   7 110.9   1
raw IDE       1472M 37432  44 36824   3 15037   4 43167  71 35088   3 113.2   2
raw virtio    1472M 28301  39 30347   5 19738   5 41751  65 43537   7 109.4   1
qcow2 old IDE 1472M 20777  26 21894   2  9257   2 36482  60 30461   2  67.4   0


                    ------Sequential Create------ --------Random Create--------
                    -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
              files  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP
qcow2 IDE        16   296  29 +++++ +++   594  16   276  29 +++++ +++   537  18
qcow2 virtio     16   303  22 +++++ +++   609  14   323  24 +++++ +++   589  20
raw IDE          16   288  28 +++++ +++   550  15   272  27 +++++ +++   525  18
raw virtio       16   344  47 +++++ +++   656  57   324  47 +++++ +++   604  60
qcow2 old IDE    16    83  22 +++++ +++   121  14    84  22 +++++ +++   280  15