I have a KVM host server running Ubuntu 12.04 LTS, bare bones installation with only KVM installed. The server has an 8 Core Intel(R) Xeon(R) CPU E3-1230 V2 @ 3.30GHz CPU with 32GB of RAM and SATA controller: Intel Corporation 6 Series/C200 Series Chipset Family SATA AHCI Controller (rev 05). There are two physical disks installed in a mdraid 1. I am using LVM partitions for /, /var, swap.

I am seeking advice on optimizing the disk performance of my KVM guests on this host configuration. My guests are running Ubuntu 12.04 LTS. One guest runs a CrashPlan PROe Master (not storage) Server (http://www.crashplan.com/enterprise/). CrashPlan PROe Server uses a database that is being read/written fairly intensively with our CrashPlan topology and load. As such, log reviews are indicating that transactions are waiting resulting in degraded performance.

My current guest parameters include:

  • Storage Format: RAW
  • Disk Bus: SATA
  • Cache Mode: None
  • IO Mode: Default
  • Memory Allocation: 8192 MB
  • CPU Allocation: 4

Can anyone suggest best practices to host or guest configuration to optimize performance of KVM guests disk IO performance particularly for random read/write (database)?


2 Answers 2


I strongly suggest you to try with cache=writeback

With recent OS as guests it will be equally safe (if not better) but generally much faster then cache=none.

I conducted some tests in the past, you can read more here: http://www.ilsistemista.net/index.php/virtualization/43-kvm-scalability-and-consolidation-ratio-cache-none-vs-cache-writeback.html

As a side note, be sure to using VirtIO drivers to get the most from yours HDDs.

  • Wouldn't you only want to enable the write back cache on the host with the real disks, not the guests? Aug 24, 2015 at 15:58
  • 1
    From the guest perspective, a write back enabled vdisk is like a real disk with an huge (and fast) DRAM cache. If you use a modern OS as guest (one capable of correctly issue wrote barriers using ATA flush commands or ATA FUAs, the guest can benefit from significantly faster disk I/O. Form more information, please read here: ilsistemista.net/index.php/virtualization/…
    – shodanshok
    Aug 24, 2015 at 16:05
  • 1
    It's the same thing. The advise to use cache=none was given on the grounds that 1) writeback was unsafe and that 2) double-caching was something to avoid. However, moder guest OS coupled with recent KVM versions (with barrier-passing support) obsoleted point n.1, and the vast amount of low-cost memory / high perf CPU available for hypervisors sidestepped point n.2 On the plus side, enabling writeback cache can significantly increase guest I/O speed, as both reads and writes are cached in the large hypervisor/hosts memory pool.
    – shodanshok
    Aug 24, 2015 at 16:46
  • 1
    As an example consider a large memory (128 GB+) hypervisor hosting many small (1-4 GB) VMs. With cache=none, each virtual machine is in charge of caching its own data but, having limited memory resources, it can not cache much. Using cache=writeback each VM continue to cache the most recent data, but this time the hypervisor is also caching other potentially useful data. The double caching scheme means that some more CPU cycles are used, but is has no negative effects on memory pressure (cache/buffers can be reclaimed almost immediately). For more info, please reads the provided links.
    – shodanshok
    Aug 24, 2015 at 16:53
  • 1
    where I can read about "obsoleted point n.1" ?
    – zombi_man
    Dec 7, 2015 at 8:22

Unless you are using SSD's already then your two disk RAID1 configuration is going to be extremely limiting for random IO. You need more disk spindles in a configuration such as RAID10 or some SSD's to get more performance.

You should also be using VIRTIO as your storage interface on all guests.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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