[libvirt-users] libvirt and cgroups/blkio

Hi, is there a way to configure blkio via libvirt (xml)? Regards Erkan -- über den grenzen muß die freiheit wohl wolkenlos sein

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 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 -- Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

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? As Im stucked to LXC Ive got no great choice. Regards Erkan -- über den grenzen muß die freiheit wohl wolkenlos sein

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@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On Mon, Oct 29, 2012 at 03:56:18PM -0600, Eric Blake wrote: [snip great explanation] great! thx a lot :) erkan -- über den grenzen muß die freiheit wohl wolkenlos sein
participants (2)
-
Eric Blake
-
erkan yanar