KVM I/O performance: Raw partitions versus image files
We have a VM framework based on KVM where we slice our drives up into partitions of specific sizes and create our VMs against these partitions. For example, we might have a command such as
Code:
virt-install --connect=qemu:///system \ We were wondering if VMs mapped to physical partitions have any performance advantages over VMs that use pre-allocated image files. For example, instead of paritions sda3 and sda4 above, let's say we did this: Code:
virt-install --connect=qemu:///system \ The image files I am referring to here would be created using something like dd. I have never experimented with qcow2 image files. Would these be an option? I am running KVM/libvirt under CentOS 6.3. |
I have seen some tests of raw (as in dd) versus qcow2. I'd think that many raw device files could be faster but that leads us to question how one set up the drive mapping and such for the image.
The advantages of qcow 1,2 and three have little to do with speed. They have many other advantages that you may or may not wish to use. A qcow in grow does take a time penalty. Use of snapshots and other features would also but return in it's need or use. Now as to a dd file or a single partition, I'd guess if both were optimized for the devices, then the test would be mostly equal. From my simple tests, all hard drive access is counted the same. Only in some compressed formats do the disk numbers increase. That is to say if you had data that could compress well then need to access in on a fast cpu it could exceed the speed of the drive. |
Intuitively, I'd think using partitions directly as opposed to image files (even non-sparse) would be faster. A VM accessing its virtual drive would have to go through another translation layer, would it not, if the virtual file system was mapped to a file instead of a raw partition? Or does the KVM drive management bypass the host's file system layer and talk directly to the device when image files are used?
|
I don't believe it does bypass the hosts drive access principals. In some newer implementations of vm, the host may have access to more real hardware but I don't think that is your case.
The only way to prove would be many tests on vm raw image versus vm mounting of a real partition. I'd guess them to be almost the same. I have never seen actual tests posted. Maybe the qemu or kvm creators or advanced users would know for sure. |
Have seen this other thread http://www.linuxquestions.org/questi...ks-4175447782/ ?
|
That's an interesting post, but unfortunately there are no follow-ups. Plus it doesn't have a comparison with using raw partitions and image files. Ultimately it appears we will have to run our own benchmarks. There's not a lot of information out there...
|
If you know anyone who's got actual RHEL, they could ask RH.
|
An excellent suggestion! I just checked with my brother and they run RHEL at their university where he's the Data Center Manager. I'm sure he'll want a favor in return for his help... :-)
|
Cool; in that case my requested favour is please post any info you get :)
|
Sadly, after I went into detail what I wanted him to ask Redhat, he said "Wait, we have a educational license. No support."
Alas, I'll need to look elsewhere... |
In that case I think you're down to serious googling and/or just trying it...
|
All times are GMT -5. The time now is 11:20 AM. |