hdparm - virtio disk performance

Latest response

This is a version 6 host. I try do benchmark disk performance.

$ sudo hdparm -T /dev/md4

/dev/md4:
 Timing cached reads:   22048 MB in  1.99 seconds = 11077.04 MB/sec

When I do this on a version 5 kvm guest I get different results.

# hdparm -T /dev/vdc

/dev/vdc:
 Timing cached reads:   29296 MB in  2.00 seconds = 14679.82 MB/sec
HDIO_DRIVE_CMD(null) (wait for flush complete) failed: Inappropriate ioctl for device
HDIO_DRIVE_CMD(null) (wait for flush complete) failed: Inappropriate ioctl for device

The guest is more performant? What the... can't believe that. And what is this ioctl thing? However, next step on the host:

# hdparm -t /dev/md4

/dev/md4:
 Timing buffered disk reads:  944 MB in  3.00 seconds = 314.50 MB/sec

On the guest it is slower, however this is expected somehow

# hdparm -t /dev/vdc

/dev/vdc:
 Timing buffered disk reads:  886 MB in  3.01 seconds = 294.79 MB/sec
HDIO_DRIVE_CMD(null) (wait for flush complete) failed: Inappropriate ioctl for device

7 percent performance loss through virtualization (294 vs. 314). But now it get's weird, next step, on the guest

# hdparm -tT /dev/vdc

/dev/vdc:
 Timing cached reads:   29660 MB in  2.00 seconds = 14862.33 MB/sec
HDIO_DRIVE_CMD(null) (wait for flush complete) failed: Inappropriate ioctl for device
 Timing buffered disk reads:  736 MB in  3.00 seconds = 245.15 MB/sec
HDIO_DRIVE_CMD(null) (wait for flush complete) failed: Inappropriate ioctl for device

This is 22 percent performance loss on disk reads (245 vs. 314). Is the hdparm test inappropriate? There are 2 things that does not make sense to me. Why is cached reads more performant on the guest? Why is disk reads much less performant on the guest when cached reads are involved also?

Markus

Responses