[libvirt] The design choice for how to enable block I/O throttling function in libvirt

HI, folks, 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. If one new libvirt command "blkiothrottle" is introduced, I plan to design its usage syntax as below: virsh # help blkiothrottle NAME blkiothrottle - Set or display a block disk I/O throttle setting. SYNOPSIS blkiothrottle <domain> <device> [--bps <number>] [--bps_rd <number>] [--bps_wr <number>] [--iops <number>] [--iops_rd <number>] [--iops_wr <number>] DESCRIPTION Set or display a block disk I/O throttle setting. OPTIONS [--domain] <string> domain name, id or uuid [--device] <string> block device --bps <number> total throughput limits in bytes/s --bps_rd <number> read throughput limits in bytes/s --bps_wr <number> write throughput limits in bytes/s --iops <number> total operation limits in numbers/s --iops_rd <number> read operation limits in numbers/s --iops_wr <number> write operation limits in numbers/s virsh # 2.) If blkiotune command is extended to enable block I/O throttling function. virsh # help blkiotune NAME blkiotune - Get or set blkio parameters SYNOPSIS blkiotune <domain> [--weight <number>] [--config] [--live] [--current] [--bps <number>] [--bps_rd <number>] [--bps_wr <number>] [--iops <number>] [--iops_rd <number>] [--iops_wr <number>] DESCRIPTION Get or set the current blkio parameters for a guest domain. To get the blkio parameters use following command: virsh # blkiotune <domain> OPTIONS [--domain] <string> domain name, id or uuid --weight <number> IO Weight in range [100, 1000] --config affect next boot --live affect running domain --current affect current domain Welcome to your suggestions or comments about how to choose it. thanks. -- Regards, Zhi Yong Wu

See commens below. Zhi Yong Wu:
HI, folks,
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.
If one new libvirt command "blkiothrottle" is introduced, I plan to design its usage syntax as below:
virsh # help blkiothrottle NAME blkiothrottle - Set or display a block disk I/O throttle setting.
SYNOPSIS blkiothrottle<domain> <device> [--bps<number>] [--bps_rd <number>] [--bps_wr<number>] [--iops<number>] [--iops_rd<number>] [--iops_wr<number>]
DESCRIPTION Set or display a block disk I/O throttle setting.
OPTIONS [--domain]<string> domain name, id or uuid [--device]<string> block device --bps<number> total throughput limits in bytes/s --bps_rd<number> read throughput limits in bytes/s --bps_wr<number> write throughput limits in bytes/s --iops<number> total operation limits in numbers/s --iops_rd<number> read operation limits in numbers/s --iops_wr<number> write operation limits in numbers/s
How to display the current I/O throttle setting of a specific block device here? I prfer to have less command to be as simple as possible for users. But it seems that we need another command here instead of having a block IO specific command like "iothrottle". Supposely, the next step of I/O throttling will be network device limit. Shoud we have another new command like "niciothrottle"?

On Tue, Aug 30, 2011 at 3:18 PM, shu ming <shuming@linux.vnet.ibm.com> wrote:
See commens below. Zhi Yong Wu:
HI, folks,
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.
If one new libvirt command "blkiothrottle" is introduced, I plan to design its usage syntax as below:
virsh # help blkiothrottle NAME blkiothrottle - Set or display a block disk I/O throttle setting.
SYNOPSIS blkiothrottle<domain> <device> [--bps<number>] [--bps_rd <number>] [--bps_wr<number>] [--iops<number>] [--iops_rd<number>] [--iops_wr<number>]
DESCRIPTION Set or display a block disk I/O throttle setting.
OPTIONS [--domain]<string> domain name, id or uuid [--device]<string> block device --bps<number> total throughput limits in bytes/s --bps_rd<number> read throughput limits in bytes/s --bps_wr<number> write throughput limits in bytes/s --iops<number> total operation limits in numbers/s --iops_rd<number> read operation limits in numbers/s --iops_wr<number> write operation limits in numbers/s
How to display the current I/O throttle setting of a specific block device here? It will show as below: virtio0: bps=xxx, bps_rd=xxx, bps_wr=xxx, iops=xxx, iops_rd=xxx, iops_wr=xxx.
I prfer to have less command to be as simple as possible for users. But it seems that we need another command here instead of having a block IO specific command like "iothrottle". I also prefer this, but would like to get other guy's suggestions, especially maintainers.
Supposely, the next step of I/O throttling will be network device limit. Shoud we have another new command like "niciothrottle"? For network device, network cgroup can cover this.
-- Regards, Zhi Yong Wu

Zhi Yong Wu:
On Tue, Aug 30, 2011 at 3:18 PM, shu ming<shuming@linux.vnet.ibm.com> wrote:
See commens below. Zhi Yong Wu:
HI, folks,
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.
If one new libvirt command "blkiothrottle" is introduced, I plan to design its usage syntax as below:
virsh # help blkiothrottle NAME blkiothrottle - Set or display a block disk I/O throttle setting.
SYNOPSIS blkiothrottle<domain> <device> [--bps<number>] [--bps_rd <number>] [--bps_wr<number>] [--iops<number>] [--iops_rd<number>] [--iops_wr<number>]
DESCRIPTION Set or display a block disk I/O throttle setting.
OPTIONS [--domain]<string> domain name, id or uuid [--device]<string> block device --bps<number> total throughput limits in bytes/s --bps_rd<number> read throughput limits in bytes/s --bps_wr<number> write throughput limits in bytes/s --iops<number> total operation limits in numbers/s --iops_rd<number> read operation limits in numbers/s --iops_wr<number> write operation limits in numbers/s
How to display the current I/O throttle setting of a specific block device here? It will show as below: virtio0: bps=xxx, bps_rd=xxx, bps_wr=xxx, iops=xxx, iops_rd=xxx, iops_wr=xxx.
With which options to the command? I guess "blkiothrottle <domain> <device>" will display the current setting.

On Tue, Aug 30, 2011 at 4:31 PM, shu ming <shuming@linux.vnet.ibm.com> wrote:
Zhi Yong Wu:
On Tue, Aug 30, 2011 at 3:18 PM, shu ming<shuming@linux.vnet.ibm.com> wrote:
See commens below. Zhi Yong Wu:
HI, folks,
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.
If one new libvirt command "blkiothrottle" is introduced, I plan to design its usage syntax as below:
virsh # help blkiothrottle NAME blkiothrottle - Set or display a block disk I/O throttle setting.
SYNOPSIS blkiothrottle<domain> <device> [--bps<number>] [--bps_rd <number>] [--bps_wr<number>] [--iops<number>] [--iops_rd<number>] [--iops_wr<number>]
DESCRIPTION Set or display a block disk I/O throttle setting.
OPTIONS [--domain]<string> domain name, id or uuid [--device]<string> block device --bps<number> total throughput limits in bytes/s --bps_rd<number> read throughput limits in bytes/s --bps_wr<number> write throughput limits in bytes/s --iops<number> total operation limits in numbers/s --iops_rd<number> read operation limits in numbers/s --iops_wr<number> write operation limits in numbers/s
How to display the current I/O throttle setting of a specific block device here?
It will show as below: virtio0: bps=xxx, bps_rd=xxx, bps_wr=xxx, iops=xxx, iops_rd=xxx, iops_wr=xxx.
With which options to the command? I guess "blkiothrottle <domain> <device>" will display the current setting. Right
-- Regards, Zhi Yong Wu

On Tue, Aug 30, 2011 at 3:55 AM, Zhi Yong Wu <zwu.kernel@gmail.com> wrote:
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. 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. 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: http://www.linux-kvm.org/wiki/images/7/72/2011-forum-keep-a-limit-on-it-io-t... Stefan
participants (3)
-
shu ming
-
Stefan Hajnoczi
-
Zhi Yong Wu