Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 ( 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)?

share|improve this question
I think this previous answer hits the high points. My feeling is you probably need more spindles or even SSD. – Michael Hampton Apr 9 '14 at 1:30

2 Answers 2

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.

share|improve this answer

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:

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

share|improve this answer
Wouldn't you only want to enable the write back cache on the host with the real disks, not the guests? – tomstephens89 Aug 24 at 15:58
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:… – shodanshok Aug 24 at 16:05
What if the vm disk storage is RAW LVM inside a host LVM group. I use Proxmox (KVM) a lot and the general suggestion is that for max performance you set the guest disk to RAW with no cache? – tomstephens89 Aug 24 at 16:12
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 at 16:46
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 at 16:53

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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