Per-Engine QoS Limits
The Longhorn V2 data engine supports per-engine Quality of Service (QoS) limits, allowing operators to cap aggregate I/O throughput (IOPS and bandwidth) on individual v2 volumes. QoS limits are enforced at the SPDK raid bdev level via bdev_set_qos_limit, providing kernel-bypass enforcement with minimal overhead.
QoS limits can be set on a per-volume basis to:
All limits default to 0 (unlimited). Limits can be updated live without detaching the volume.
QoS limits are configured via the qosLimits field on the volume’s StorageClass or via the Longhorn API.
Create a StorageClass with QoS limits:
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: longhorn-v2-qos
provisioner: driver.longhorn.io
parameters:
dataEngine: "v2"
numberOfReplicas: "2"
qosLimits: '{"rwIosPerSec":"1000","rwMbPerSec":"100"}'
This caps the volume at 1000 IOPS and 100 MB/s total throughput.
Update QoS limits on an existing volume:
kubectl -n longhorn-system exec deploy/longhorn-ui -- \
curl -s -X POST \
"http://longhorn-frontend:80/v1/volumes/<volume-name>?action=update" \
-H 'Content-Type: application/json' \
-d '{"qosLimits":{"rwIosPerSec":"2000","rwMbPerSec":"200"}}'
Patch the volume’s QoS limits directly:
kubectl -n longhorn-system patch volume <volume-name> --type=merge \
-p '{"spec":{"qosLimits":{"rwIosPerSec":"2000","rwMbPerSec":"200"}}}'
| Parameter | Description | Default |
|---|---|---|
rwIosPerSec | Total IOPS limit (read + write). 0 = unlimited. | 0 |
rwMbPerSec | Total bandwidth limit in MB/s (read + write). 0 = unlimited. | 0 |
rMbPerSec | Read bandwidth limit in MB/s. 0 = unlimited. | 0 |
wMbPerSec | Write bandwidth limit in MB/s. 0 = unlimited. | 0 |
Multiple limits can be combined. For example, capping IOPS at 1000 and write bandwidth at 50 MB/s:
{"rwIosPerSec":"1000","wMbPerSec":"50"}
QoS limits can be updated on a running volume without detaching it. The engine applies the new limits via the EngineSetQosLimit RPC, which calls SPDK’s bdev_set_qos_limit on the raid bdev in-place. There is no I/O disruption during the update.
QoS limits are applied to the raid bdev — the multipath device that the engine frontend exposes to the workload. This means:
Check the current QoS limits on a volume:
kubectl -n longhorn-system get volume <volume-name> -o jsonpath='{.spec.qosLimits}' | jq .
© 2019-2026 Longhorn a Series of LF Projects, LLC. Documentation Distributed under CC-BY-4.0.
For website terms of use, trademark policy and other project policies please see lfprojects.org/policies.