Proxmox 1.4: VirtIO slower than IDE

Maxnet

New Member
Aug 6, 2009
14
0
1
www.noc-ps.com
I'm having the problem that the performance of VirtIO is nowhere near native performance, and even slower than IDE.
Especially with random IO (seeks).

Occurs with both a raw image on the standard "directory" storage, as well as LVM on a seperate drive.
Tested with both Ubuntu 9.04 as the new 9.10 beta.


Ubuntu 9.10 VM on LVM storage with VirtIO:

Code:
bonnie++ -s 16384

Version 1.03c       ------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
ubuntu910       16G 39209  96 45383   3 29984   6 33996  73 90472   8 636.5   1
                    ------Sequential Create------ --------Random Create--------
                    -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
              files  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP
                 16 +++++ +++ +++++ +++ +++++ +++ 23837  56 +++++ +++ +++++ +++
ubuntu910,16G,39209,96,45383,3,29984,6,33996,73,90472,8,636.5,1,16,+++++,+++,+++++,+++,+++++,+++,23837,56,+++++,+++,+++++,+++
Ubuntu 9.10 VM on LVM storage with IDE:

Code:
Version 1.03c       ------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
ubuntu910       16G 38796  97 63574   5 31138   7 34604  74 92490   8  2803   7
                    ------Sequential Create------ --------Random Create--------
                    -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
              files  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP
                 16 +++++ +++ +++++ +++ +++++ +++ 23745  56 +++++ +++ +++++ +++
ubuntu910,16G,38796,97,63574,5,31138,7,34604,74,92490,8,2803.0,7,16,+++++,+++,+++++,+++,+++++,+++,23745,56,+++++,+++,+++++,+++
Ubuntu 9.04 VM on directory storage, with VirtIO:

Code:
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
ubuntu904       16G  9616  41 27917  34 28269   9 41039  92 77316  14 954.8   7
                    ------Sequential Create------ --------Random Create--------
                    -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
              files  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP
                 16 +++++ +++ +++++ +++ +++++ +++ +++++ +++ +++++ +++ +++++ +++
ubuntu904,16G,9616,41,27917,34,28269,9,41039,92,77316,14,954.8,7,16,+++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++
Ubuntu 9.04 VM on directory storage with IDE:

Code:
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
ubuntu904       16G 36565  96 42835  10 26516   7 33578  87 78293  10  2626  14
                    ------Sequential Create------ --------Random Create--------
                    -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
              files  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP
                 16 +++++ +++ +++++ +++ +++++ +++ +++++ +++ +++++ +++ +++++ +++
ubuntu904,16G,36565,96,42835,10,26516,7,33578,87,78293,10,2626.2,14,16,+++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++
Host system:

Code:
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
debian          16G 42738  98 80982  20 33531   8 43540  92 82022   6  7363  10
                    ------Sequential Create------ --------Random Create--------
                    -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
              files  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP
                 16 +++++ +++ +++++ +++ +++++ +++ +++++ +++ +++++ +++ +++++ +++
debian,16G,42738,98,80982,20,33531,8,43540,92,82022,6,7363.1,10,16,+++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++

pveperf
CPU BOGOMIPS:      32180.78
REGEX/SECOND:      531937
HD SIZE:           56.00 GB (/dev/mapper/debian-root)
BUFFERED READS:    76.59 MB/sec
AVERAGE SEEK TIME: 0.14 ms
FSYNCS/SECOND:     1295.25
DNS EXT:           283.15 ms
Configuration: dual quadcore Opteron 2350, Mtron 7000 SSD, 8 gb ram, 6 gb assigned to vm, swap disabled on both host and vm.
 
Please can you post those results to the kvm mailing lists? I also have the feeling that ide is as fast as virtio.
 
On the mailinglist it was suggested to change the IO scheduler to "deadline" on the host system.

And it indeed improves random IO a lot.
After doing on the host system: echo deadline > /sys/block/[disk device]/queue/scheduler

Virtio:

Code:
Version 1.03c       ------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
ubuntu910       16G 38776  97 61414   5 32451   7 34711  73 95325   9  7174  23
                    ------Sequential Create------ --------Random Create--------
                    -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
              files  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP
                 16 +++++ +++ +++++ +++ +++++ +++ +++++ +++ +++++ +++ +++++ +++
ubuntu910,16G,38776,97,61414,5,32451,7,34711,73,95325,9,7174.2,23,16,+++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++

IDE:

Code:
Version 1.03c       ------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
ubuntu910       16G 38779  97 62245   6 32696   7 34748  72 95059   9  2992   9
                    ------Sequential Create------ --------Random Create--------
                    -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
              files  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP
                 16 +++++ +++ +++++ +++ +++++ +++ 23192  58 +++++ +++ +++++ +++
ubuntu910,16G,38779,97,62245,6,32696,7,34748,72,95059,9,2992.0,9,16,+++++,+++,+++++,+++,+++++,+++,23192,58,+++++,+++,+++++,+++


Not sure what the implications are of using deadline instead of the standard CFQ "fair" scheduler on systems with a lot of VMs though.
 
Maybe virtio block drivers are not enabled or malfunction in guest machine, I'm using proxmox 1.3 and noticed significant speed improvements going from ide to virtio.