KVM Performance? Success!

After a few months with a new server and only lackluster performance, I finally came around doing some performance testing and tweaking and finally got that KVM box running smoothly.

The VM currently has two volumes, one raw LVM volume and one QCOW2 image. Here’re my numbers:

Before

  • raw, default settings

      Version  1.96       ------Sequential Output------ --Sequential Input- --Random-
      Concurrency   1     -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
      hosting3         2G           25510   5 27107   2           2083061  45 726.8   4
      Latency                        2442ms    1741ms              2717us     428ms
    
  • qcow, default settings

      Version  1.96       ------Sequential Output------ --Sequential Input- --Random-
      Concurrency   1     -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
      hosting3         2G           26790   3 20073   2           4159967  74 717.4   5
      Latency                        2090ms    3109ms             11201us    8661us
    

After

  • raw, cache=none, iomode=native

      Version  1.96       ------Sequential Output------ --Sequential Input- --Random-
      Concurrency   1     -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
      hosting3         2G           47621   8 57720   4           +++++ +++  1450   9
      Latency                         880ms     997ms              1633us   43612us
    
  • qcow, cache=none, iomode=native

      Version  1.96       ------Sequential Output------ --Sequential Input- --Random-
      Concurrency   1     -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
      hosting3         2G           63779   6 58150   3           +++++ +++  1485  11
      Latency                        2095ms    1243ms              2149us    4935us
    

Obviously, there’s still room for improvement - by migrating off qcow2 - but at least raw throughput has already improved and will hopefully already lead to improved responsiveness of the VM.