Skip to content

Allow limiting IO operation size (KVM) #8384

Open
@salfers

Description

@salfers
ISSUE TYPE
  • Improvement Request
COMPONENT NAME
KVM hypervisor
CLOUDSTACK VERSION
4.18 or latest
SUMMARY

The qemu documentation explains why this is important:

When applying IOPS limits all I/O operations are treated equally
regardless of their size. This means that the user can take advantage
of this in order to circumvent the limits and submit one huge I/O
request instead of several smaller ones.

QEMU provides a setting called throttling.iops-size to prevent this
from happening. This setting specifies the size (in bytes) of an I/O
request for accounting purposes. Larger requests will be counted
proportionally to this size.

In libvirt this option is called size_iops_sec inside the <iotune> section (ref).

Other big clouds such as AWS also use this mechanism to fairly allocate IOPS.

STEPS TO REPRODUCE

Checking the CloudStack code shows that this option is currently not supported:

diskBuilder.append("<iotune>\n");
if ((_bytesReadRate != null) && (_bytesReadRate > 0))
diskBuilder.append("<read_bytes_sec>" + _bytesReadRate + "</read_bytes_sec>\n");
if ((_bytesWriteRate != null) && (_bytesWriteRate > 0))
diskBuilder.append("<write_bytes_sec>" + _bytesWriteRate + "</write_bytes_sec>\n");
if ((_iopsReadRate != null) && (_iopsReadRate > 0))
diskBuilder.append("<read_iops_sec>" + _iopsReadRate + "</read_iops_sec>\n");
if ((_iopsWriteRate != null) && (_iopsWriteRate > 0))
diskBuilder.append("<write_iops_sec>" + _iopsWriteRate + "</write_iops_sec>\n");
if (s_qemuVersion >= 2004000) {
if (_bytesReadRateMax != null && _bytesReadRateMax > 0 ) {
diskBuilder.append("<read_bytes_sec_max>" + _bytesReadRateMax + "</read_bytes_sec_max>\n");
}
if (_bytesWriteRateMax != null && _bytesWriteRateMax > 0) {
diskBuilder.append("<write_bytes_sec_max>" + _bytesWriteRateMax + "</write_bytes_sec_max>\n");
}
if (_iopsReadRateMax != null && _iopsReadRateMax > 0)
diskBuilder.append("<read_iops_sec_max>" + _iopsReadRateMax + "</read_iops_sec_max>\n");
if (_iopsWriteRateMax != null && _iopsWriteRateMax > 0)
diskBuilder.append("<write_iops_sec_max>" + _iopsWriteRateMax + "</write_iops_sec_max>\n");
}
if (s_qemuVersion >= 2006000) {
if (_bytesReadRateMaxLength != null && _bytesReadRateMaxLength > 0) {
diskBuilder.append("<read_bytes_sec_max_length>" + _bytesReadRateMaxLength + "</read_bytes_sec_max_length>\n");
}
if (_bytesWriteRateMaxLength != null && _bytesWriteRateMaxLength > 0) {
diskBuilder.append("<write_bytes_sec_max_length>" + _bytesWriteRateMaxLength + "</write_bytes_sec_max_length>\n");
}
if (_iopsReadRateMaxLength != null && _iopsReadRateMaxLength > 0)
diskBuilder.append("<read_iops_sec_max_length>" + _iopsReadRateMaxLength + "</read_iops_sec_max_length>\n");
if (_iopsWriteRateMaxLength != null && _iopsWriteRateMaxLength > 0)
diskBuilder.append("<write_iops_sec_max_length>" + _iopsWriteRateMaxLength + "</write_iops_sec_max_length>\n");
}
diskBuilder.append("</iotune>\n");

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Todo

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions