Features/KVM qcow2 Performance
KVM qcow2 Performance
Improve the I/O performance of virtual machines using disk images in the qcow2 image format.
- Name: Kevin Wolf
- Targeted release: Fedora 12
- Last updated: 2009-07-01
- Percentage of completion: 80%
(More details to add)
qcow2 is the native disk image file format of qemu. It provides a couple of additional features over raw images, including base images, snapshots, compression and encryption. Also, qcow2 files grow as needed whereas raw files need to be created in the full size of the virtual disk.
Currently, qcow2 is very slow with disabled write cache on the host. Therefore users need to decide if they enable the write cache and run the risk of data loss (e.g. on a host crash, the guest thinks the data is written to disk and safe while it was sitting in the host cache and is lost - resulting in image or file system corruption) or to do without the qcow2 features and go for raw images.
The goal is to improve the performance of qcow2, so users don't risk their data, can take advantage from the additional features provided by qcow2 and still have acceptable performance.
Benefit to Fedora
See previous section. We can recommend a more advanced image format than raw to our users.
This feature needs work on qemu. A lot of changes are already made in upstream qemu and just need to be taken from there.
How To Test
Even though the major goal is to improve performance, it is easy to break the image format driver in subtle ways while doing so. Testing must have a focus on correctness first. A good way to test correctness is the qemu-iotests test suite which can be found on http://git.kernel.org/?p=linux/kernel/git/hch/qemu-iotests.git.
Apart from correctness, testing should involve performance comparison between qcow2 and raw (possibly also old qcow2) in benchmarks, installation or other scenarios. Be sure to differentiate between an empty image which is growing during the test and an already used image with lots of rewrites. The greatest performance improvement is to be expected in the growing case. Best start off with new images before each test run to maintain comparability.
qcow2 users should notice no change in functionality, but an improvement in their disk I/O performance. Users who have previously enabled the write cache for performance reasons may consider to turn caching off to improve data safety. Users who didn't use qcow2 because of the poor performance may consider to switch and take advantage of the additional features.
None. We would take the improvements already available and reconsider if we can recommend using qcow2 to everyone. The raw image format is retained and can still be used when performance is important.
(To be written)