[libvirt-users] libvirt and cgroups/blkio

Eric Blake eblake at redhat.com
Mon Oct 29 21:56:18 UTC 2012


On 10/29/2012 03:22 PM, erkan yanar wrote:
> Hi Eric,
> 
> On Mon, Oct 29, 2012 at 02:28:25PM -0600, Eric Blake wrote:
>> On 10/29/2012 02:32 AM, erkan yanar wrote:
>>>
>>> Hi,
>>>
>>> is there a way to configure blkio via libvirt (xml)?
>>
>> Yes, via <blkiotune> in the XML, or 'virsh blkiotune':
>> http://libvirt.org/formatdomain.html#elementsBlockTuning
> 
> facepalm .. thx
>>
>> But note that <blkiotune> is not necessarily the best way to tune I/O;
>> if you have new enough qemu, you might find better results with
>> per-device tuning by using <iotune>, or 'virsh 'blkdeviotune':
>> http://libvirt.org/formatdomain.html#elementsDisks
> 
> Uh whats so bad about blkiotune?

In the case of qemu - if you stick two disk images as files residing
within the same file system on the same block device from the host
perspective, then <blkiotune> can only throttle the underlying device
(the two disks share the same throttling, and you have no control over
one disk can starve the other within the guest - due to cgroup doing the
throttling via the host), whereas per-device <iotune> can individually
throttle the two disk images at different rates (completely independent
throttling, due to qemu doing the throttling at the disk image layer).

> As Im stucked to LXC Ive got no great choice.

Indeed - with LXC, all you can use is <blkiotune> to throttle individual
block devices passed through to the guest, as LXC isn't really using
disk images in the same manner as qemu, and therefore isn't implementing
per-disk-image throttling of <iotune>.

So overall, I'm not saying that <blkiotune> is bad, just that it can't
do everything that qemu can do.  But what qemu can do may be irrelevant
to your LXC usage, so give <blkiotune> a try :)

-- 
Eric Blake   eblake at redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 617 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20121029/070457af/attachment.sig>


More information about the libvirt-users mailing list