# XEN HVM storage I/O problem



## alfikmik (Jun 11, 2014)

I've got another problem (first of all I'd like to say it doesn't depends on kernel virtualization option). So better will be when I paste here some data from my performed experiences.

First of all the results for a real machine:


```
CPU: Pentium(R) Dual-Core CPU E5700 @ 3.00GHz
real memory = 1063124992 (1013 MB)
atacontrol list
ad0 <ST3500413AS/JC45> Serial ATA II
```


```
ioping -R -w 10 /dev/ad0s1

--- /dev/ad0s1 (device 74.5 GiB) ioping statistics ---
1.0 k requests completed in 10.0 s, 104 iops, 416.1 KiB/s
min/avg/max/mdev = 2.3 ms / 9.6 ms / 62.2 ms / 3.8 ms
```


```
dd if=/dev/zero of=test bs=1k count=1M
1048576+0 records in
1048576+0 records out
1073741824 bytes transferred in 12.278704 secs (87447489 bytes/sec)
```


```
ddpt if=/dev/zero of=test bs=1k count=1M conv=fdatasync
1048576+0 records in
1048576+0 records out
time to transfer data: 13.009085 secs at 82.54 MB/sec
```


```
dd of=/dev/null if=test 
2097152+0 records in
2097152+0 records out
1073741824 bytes transferred in 12.070636 secs (88954867 bytes/sec)
```


```
ddpt of=/dev/null if=test conv=fdatasync
Assume block size of 512 bytes for both input and output
2097152+0 records in
0+0 records out
time to read data: 11.705054 secs at 91.73 MB/sec
```

The second one is XEN HVM:


```
ioping -R -w 10 /dev/ada0a 

--- /dev/ada0a (device 55.0 Gb) ioping statistics ---
153 requests completed in 10.1 s, 15 iops, 60.6 kb/s
min/avg/max/mdev = 522 us / 66.0 ms / 202.2 ms / 42.0 ms
```


```
dd if=/dev/zero of=test bs=1k count=1M 
1048576+0 records in
1048576+0 records out
1073741824 bytes transferred in 4.793476 secs (224000674 bytes/sec)
```


```
ddpt if=/dev/zero of=test bs=1k count=1M conv=fdatasync 
1048576+0 records in
1048576+0 records out
time to transfer data: 8.360690 secs at 128.43 MB/sec
```


```
dd of=/dev/null if=test 
2097152+0 records in
2097152+0 records out
1073741824 bytes transferred in 4.487605 secs (239268353 bytes/sec)
```


```
ddpt of=/dev/null if=test conv=fdatasync
Assume block size of 512 bytes for both input and output
2097152+0 records in
0+0 records out
time to read data: 3.903435 secs at 275.08 MB/sec
```

And the last one is KVM:


```
ioping -R -w 10 /dev/vtbd0a 

--- /dev/vtbd0a (device 55.0 Gb) ioping statistics ---
1.2 k requests completed in 10.0 s, 123 iops, 493.4 kb/s
min/avg/max/mdev = 241 us / 8.1 ms / 91.5 ms / 5.5 ms
```


```
dd if=/dev/zero of=test bs=1k count=1M 
1048576+0 records in
1048576+0 records out
1073741824 bytes transferred in 6.950562 secs (154482734 bytes/sec)
```


```
ddpt if=/dev/zero of=test bs=1k count=1M conv=fdatasync 
1048576+0 records in
1048576+0 records out
time to transfer data: 10.699909 secs at 100.35 MB/sec
```


```
dd of=/dev/null if=test 
2097152+0 records in
2097152+0 records out
1073741824 bytes transferred in 4.429863 secs (242387141 bytes/sec)
```


```
ddpt of=/dev/null if=test conv=fdatasync
Assume block size of 512 bytes for both input and output
2097152+0 records in
0+0 records out
time to read data: 0.346330 secs at 3100.34 MB/sec
```

Both (XEN HVM and KVM) machines are in the same configuration: 2 cores 2,8G_H_z, 2GB RAM, 60GB HDD

I've tested both of them with and without kernel modules for virtualization.  As you can see transfer rate for *XEN HVM* is pretty good but *I/O operations* are definitely too low for this one who wants to now for *KVM *better is if we enable *kernel virtualization modules* and for DomU disk driver is set to *virtio*.

I forgot mention that my tests was done with FreeBSD 9.0, 9.2 and 10.0, all amd64 (i386 sucks here); data pasted above are for FreeBSD 10.0 amd64.


----------

