Skip to contentSkip to conversation

block I/O throttling: how to enable in libvirt

RFC Zhi Yong Wu 4 participants 4 messages Sep 1, 2011 – Sep 2, 2011

lore
Share & tools
lore
#0 lore raw

----- Forwarded message from Zhi Yong Wu <[email protected]> -----
Date: Thu, 1 Sep 2011 11:55:17 +0800
From: Zhi Yong Wu <[email protected]>
To: Stefan Hajnoczi <[email protected]>
Cc: "Daniel P. Berrange" <[email protected]>, Stefan Hajnoczi
<[email protected]>, Adam Litke <[email protected]>, Zhi Yong Wu <[email protected]>, QEMU Developers <[email protected]>, [email protected], [email protected]
Subject: [RFC] block I/O throttling: how to enable in libvirt
Message-ID: <[email protected]>
References: <CAEH94Li_C=BOe2gV8NyM48njYWMBAo9MTGc1eUOh-Y=cODs6VA@mail.gmail.com>

	<CAJSP0QW1CPCokX=F5z7y==vn1S4wH0VtOaQ7oj4kC7f7uQM4MQ@mail.gmail.com>
	<[email protected]>
	<CAJSP0QUHm=y8XJC_KXRg7ufFZt3K_XDDfQb--sxjC+c0GjO8qg@mail.gmail.com>

MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <CAJSP0QUHm=y8XJC_KXRg7ufFZt3K_XDDfQb--sxjC+c0GjO8qg@mail.gmail.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Xagent-From: [email protected]
X-Xagent-To: [email protected]
X-Xagent-Gateway: vmsdvma.vnet.ibm.com (XAGENTU7 at VMSDVMA)

Quoted 62 lines · Stefan Hajnoczi

Subject: Re: The design choice for how to enable block I/O throttling function in libvirt
From: Stefan Hajnoczi <[email protected]>
To: Adam Litke <[email protected]>
Cc: [email protected], "Daniel P. Berrange" <[email protected]>, Zhi Yong Wu <[email protected]>, Zhi Yong Wu <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Brightmail-Tracker: AAAAAA==
X-Xagent-From: [email protected]
X-Xagent-To: [email protected]
X-Xagent-Gateway: bldgate.vnet.ibm.com (XAGENTU7 at BLDGATE)

Quoted 20 lines · Adam Litke
Quoted 9 lines · Stefan Hajnoczi
Quoted 5 lines · Zhi Yong Wu

I am trying to enable block I/O throttling function in libvirt. But currently i met some design questions, and don't make sure if we should extend blkiotune to support block I/O throttling or introduce one new libvirt command "blkiothrottle" to cover it or not. If you have some better idea, pls don't hesitate to drop your comments.

A little bit of context: this discussion is about adding libvirt support for QEMU disk I/O throttling.

Thanks for the additional context Stefan.

Quoted 6 lines

Today libvirt supports the cgroups blkio-controller, which handles proportional shares and throughput/iops limits on host block devices. blkio-controller does not support network file systems (NFS) or other QEMU remote block drivers (curl, Ceph/rbd, sheepdog) since they are not host block devices.  QEMU I/O throttling works with all types of -drive and therefore complements blkio-controller.

Quoted 5 lines

The first question that pops into my mind is: Should a user need to understand when to use the cgroups blkio-controller vs. the QEMU I/O throttling method?  In my opinion, it would be nice if libvirt had a single interface for block I/O throttling and libvirt would decide which mechanism to use based on the type of device and the specific limits that need to be set.

Yes, I agree it would be simplest to pick the right mechanism, depending on the type of throttling the user wants. More below.

Quoted 5 lines
Quoted 4 lines

I/O throttling can be applied independently to each -drive attached to a guest and supports throughput/iops limits.  For more information on this QEMU feature and a comparison with blkio-controller, see Ryan Harper's KVM Forum 2011 presentation:

Quoted 7 lines
Quoted 1 line

http://www.linux-kvm.org/wiki/images/7/72/2011-forum-keep-a-limit-on-it-io-throttling-in-qemu.pdf

From the presentation, it seems that both the cgroups method the the qemu method offer comparable control (assuming a block device) so it might possible to apply either method from the same API in a transparent manner.  Am I correct or are we suggesting that the Qemu throttling approach should always be used for Qemu domains?

QEMU I/O throttling does not provide a proportional share mechanism. So you cannot assign weights to VMs and let them receive a fraction of the available disk time. That is only supported by cgroups blkio-controller because it requires a global view which QEMU does not have.

Quoted 5 lines

So I think the two are complementary:

If proportional share should be used on a host block device, use cgroups blkio-controller.
Otherwise use QEMU I/O throttling.

Stefan,

Do you agree with introducing one new libvirt command blkiothrottle now? If so, i will work on the code draft to make it work.

Daniel and other maintainers,

If you are available, can you make some comments for us?:)

Regards,

Zhi Yong Wu

Quoted 2 lines

Stefan

----- End forwarded message -----

#1 lore raw
Quoted 24 lines · Zhi Yong Wu
Quoted 23 lines · Stefan Hajnoczi
Quoted 6 lines · Adam Litke
Quoted 4 lines · Stefan Hajnoczi

I/O throttling can be applied independently to each -drive attached to a guest and supports throughput/iops limits.  For more information on this QEMU feature and a comparison with blkio-controller, see Ryan Harper's KVM Forum 2011 presentation:

Quoted 7 lines
Quoted 1 line

http://www.linux-kvm.org/wiki/images/7/72/2011-forum-keep-a-limit-on-it-io-throttling-in-qemu.pdf

From the presentation, it seems that both the cgroups method the the qemu method offer comparable control (assuming a block device) so it might possible to apply either method from the same API in a transparent manner.  Am I correct or are we suggesting that the Qemu throttling approach should always be used for Qemu domains?

QEMU I/O throttling does not provide a proportional share mechanism. So you cannot assign weights to VMs and let them receive a fraction of the available disk time. That is only supported by cgroups blkio-controller because it requires a global view which QEMU does not have.

So I think the two are complementary:

Quoted 7 lines
Quoted 3 lines

If proportional share should be used on a host block device, use cgroups blkio-controller.
Otherwise use QEMU I/O throttling.

Stefan,

Do you agree with introducing one new libvirt command blkiothrottle now? If so, i will work on the code draft to make it work.

No, I think that the blkiotune command should be extended to support QEMU I/O throttling. This is not new functionality, we already have cgroups blkio-controller support today. Therefore I think it makes sense to keep a unified interface instead of adding a new command.

Stefan

#2 lore raw
Quoted 30 lines · Stefan Hajnoczi
Quoted 29 lines · Zhi Yong Wu
Quoted 21 lines · Stefan Hajnoczi
Quoted 6 lines · Adam Litke
Quoted 4 lines · Stefan Hajnoczi

I/O throttling can be applied independently to each -drive attached to a guest and supports throughput/iops limits.  For more information on this QEMU feature and a comparison with blkio-controller, see Ryan Harper's KVM Forum 2011 presentation:

Quoted 7 lines
Quoted 1 line

http://www.linux-kvm.org/wiki/images/7/72/2011-forum-keep-a-limit-on-it-io-throttling-in-qemu.pdf

From the presentation, it seems that both the cgroups method the the qemu method offer comparable control (assuming a block device) so it might possible to apply either method from the same API in a transparent manner.  Am I correct or are we suggesting that the Qemu throttling approach should always be used for Qemu domains?

QEMU I/O throttling does not provide a proportional share mechanism. So you cannot assign weights to VMs and let them receive a fraction of the available disk time. That is only supported by cgroups blkio-controller because it requires a global view which QEMU does not have.

Quoted 5 lines

So I think the two are complementary:

If proportional share should be used on a host block device, use cgroups blkio-controller.
Otherwise use QEMU I/O throttling.

Stefan,

Quoted 7 lines
Quoted 2 lines

Do you agree with introducing one new libvirt command blkiothrottle now? If so, i will work on the code draft to make it work.

No, I think that the blkiotune command should be extended to support QEMU I/O throttling. This is not new functionality, we already have cgroups blkio-controller support today. Therefore I think it makes sense to keep a unified interface instead of adding a new command.

Agreed, the virDomainGetBlkioParameters/virDomainSetBlkioParameters APIs, and blkio virsh command are intended to be a generic interface for setting any block related tuning parameters, regardless of what the underling implementation is. So any use of QEMU I/O throttling features should be added to those APIs/commands.

Daniel

Signature · 4 lines
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|
#3 lore raw
In reply to Stefan Hajnoczi
Quoted 30 lines · Stefan Hajnoczi
Quoted 29 lines · Zhi Yong Wu
Quoted 21 lines · Stefan Hajnoczi
Quoted 6 lines · Adam Litke
Quoted 4 lines · Stefan Hajnoczi

I/O throttling can be applied independently to each -drive attached to a guest and supports throughput/iops limits. For more information on this QEMU feature and a comparison with blkio-controller, see Ryan Harper's KVM Forum 2011 presentation:

Quoted 7 lines
Quoted 1 line

http://www.linux-kvm.org/wiki/images/7/72/2011-forum-keep-a-limit-on-it-io-throttling-in-qemu.pdf

From the presentation, it seems that both the cgroups method the the qemu method offer comparable control (assuming a block device) so it might possible to apply either method from the same API in a transparent manner. Am I correct or are we suggesting that the Qemu throttling approach should always be used for Qemu domains?

QEMU I/O throttling does not provide a proportional share mechanism. So you cannot assign weights to VMs and let them receive a fraction of the available disk time. That is only supported by cgroups blkio-controller because it requires a global view which QEMU does not have.

Quoted 5 lines

So I think the two are complementary:

If proportional share should be used on a host block device, use cgroups blkio-controller.
Otherwise use QEMU I/O throttling.

Stefan,

Quoted 7 lines
Quoted 2 lines

Do you agree with introducing one new libvirt command blkiothrottle now? If so, i will work on the code draft to make it work.

No, I think that the blkiotune command should be extended to support QEMU I/O throttling. This is not new functionality, we already have cgroups blkio-controller support today. Therefore I think it makes sense to keep a unified interface instead of adding a new command.

Agreed.
Proportional controlling interfaces and throttling interfaces are all the same cgroup subsystem. So Just extend blkiotune to add new options to support throttling tuning.

Thanks,
Gui

Quoted 4 lines

Stefan