Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

librbd QoS settings for RBD based PVs #521

Closed
mmgaggle opened this issue Aug 2, 2019 · 19 comments · Fixed by #4089
Closed

librbd QoS settings for RBD based PVs #521

mmgaggle opened this issue Aug 2, 2019 · 19 comments · Fixed by #4089
Labels
component/rbd Issues related to RBD keepalive This label can be used to disable stale bot activiity in the repo

Comments

@mmgaggle
Copy link
Member

mmgaggle commented Aug 2, 2019

Describe the feature you'd like to have

The ability to set librbd QoS settings on a PV to limit how much IO can be consumed from the Ceph Cluster.

The exactly limits would be informed through the storage-class configuration. Ideally we would support three different types of limits:

  1. static rbd_qos_iops_limit and rbd_qos_bps_limit per volume
  2. dynamic rbd_qos_iops_limit and rbd_qos_bps_limit per volume as a function of the PV size (eg. 3 IOPS per GB, 100 MB/s per TB with a configurable rbd_qos_schedule_tick_min.

A PVC could specify the number of IOPs from storage classes of the second type, but it would adjust the capacity requested based on the above ratio configured in the storage class definition.

What is the value to the end user?

Many users were frustrated by IO noisy neighbor issues in early Ceph deployments that were catering to OpenStack environments. Folks started to implement QEMU throttling at the virtio-blk/scsi and this became much more manageable. Capacity based IOPs further improved on the situation by providing familiar a public cloud like experience (vs static per volume limits).

We want Kubernetes and OpenShift users to have improved noisy neighbor isolation too!

How will we know we have a good solution?

  1. Configure ceph-csi to use nbd-rbd approach.
  2. Provision volume from storage class as configured above.
  3. CSI provisioner would set limit on RBD image.
  4. fio test against PV would confirm that IOPs limits were being enforced.

Once resize work is finished, we'll need to ensure new limits are applied when a volume is re-sized.

@fire
Copy link

fire commented Dec 15, 2019

Is anyone working on this? What is the status of this?

@dillaman
Copy link

I don't believe anyone is working on it -- and it really doesn't make much sense since rbd-nbd isn't really production worthy (right now), so we wouldn't want to encourage even more folks using it.

The best longer term solution would be to ensure cgroups v2 is being utilized on the k8s node so that generic block rate limiting controls can be applied (which would handle krbd both rbd-nbd). I'm not sure of the realistic timeline for cgroups v2 integration in k8s (it just became the default under Fedora 31).

@fire
Copy link

fire commented Dec 16, 2019

Do you know where cgroups v2 integration in k8s for limiting block rates is tracked?

@dillaman
Copy link

This [1] provides a really good overview and a theoretical timeline

[1] https://medium.com/nttlabs/cgroup-v2-596d035be4d7

@mmgaggle
Copy link
Member Author

The bigger problem with cgroups is that they only provide independent limits for read and write, compared with libdrbd/virtio which provide the ability to express limits against the aggregate of reads and writes.

If I want to limit a given PV to 100 IOPs, I can't do that with cgroups. I can only set a write IOPs limit to (50, 30, 10) and another distinct limit on read IOPS (50, 70, 90). A client can't trade a write IO for a read IO, or vis versa.

@mmgaggle
Copy link
Member Author

mmgaggle commented Apr 2, 2020

Probably would need something like this KEP to do accounting -

kubernetes/enhancements#1353

Basically if you know a cluster can provide 100k iops and 100TB, then you need to add up the PVs (qty * static limit, or capacity * ratio limit) to make sure you're not oversubscribed.

@nixpanic nixpanic added the component/rbd Issues related to RBD label Apr 17, 2020
@stale
Copy link

stale bot commented Oct 4, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in a week if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Oct 4, 2020
@stale
Copy link

stale bot commented Oct 12, 2020

This issue has been automatically closed due to inactivity. Please re-open if this still requires investigation.

@stale stale bot closed this as completed Oct 12, 2020
@Madhu-1 Madhu-1 reopened this Nov 4, 2020
@stale stale bot removed the wontfix This will not be worked on label Nov 4, 2020
@Madhu-1 Madhu-1 added the keepalive This label can be used to disable stale bot activiity in the repo label Nov 4, 2020
@matti
Copy link

matti commented Jan 23, 2021

Why isn't this a top priority issue? a rogue pod can destroy the ceph cluster

@matti
Copy link

matti commented Jan 23, 2021

"The noisy neighbor problem". Without this feature Rook won't be useable in production, as you can slow down the whole cluster by e.g extracting a huge gzip file.

(rook/rook#1499 (comment))

@mykaul
Copy link
Contributor

mykaul commented Jan 24, 2021

Why isn't this a top priority issue? a rogue pod can destroy the ceph cluster

@matti - do you have any code for this you'd like to share with the community? That would be most welcome and will certainly help prioritizing this work.

@pre
Copy link

pre commented Jan 25, 2021

do you have any code for this you'd like to share with the community?

Are you requesting example code for demonstrating the problem or the solution?

The example code for demonstrating the problem is very simple. It's enough to unpack a huge gzip file or run dd. You just need to run them parallel from different nodes so that these rogue clients overwhelm the Ceph cluster.

TL;DR Any centralized limit for IOPS (eg. 3 IOPS per GB, 100 MB/s per TB) would be needed. The limit needs to be on the top so that you can't workaround the limit by having enough rogue clients in parallel.

@mykaul
Copy link
Contributor

mykaul commented Jan 25, 2021

do you have any code for this you'd like to share with the community?

Are you requesting example code for demonstrating the problem or the solution?

The solution. I'm well aware of the issue.

@michaelgeorgeattard
Copy link

Hi, are there any plans or updates on this topic please?

@knfoo
Copy link

knfoo commented Sep 30, 2021

I am also very interested in this feature 👍

@HaveFun83
Copy link

Great feature. Any news here?

@matti
Copy link

matti commented Dec 8, 2022

no news, rogue pod can still destroy the entire ceph cluster

@m-yosefpor
Copy link

some container runtimes (such as cri-o) support iops
and BW limitation on pods. You need to add some annotation to pods (with a policy engine like kyverno or custom webhooks) to ensure pods are limited. see here fore more info: cri-o/cri-o#4873

@matti
Copy link

matti commented Dec 8, 2022

but bandwidth limit ensures that performance is always limited, eg. always bad.

This issue is about Quality of Service where pods would be allowed to burst to maximum while still preventing exhaustion.

Madhu-1 added a commit to Madhu-1/ceph-csi that referenced this issue Aug 29, 2023
Add design doc for QOS for rbd
devices mapped with both krbd
and rbd-nbd

closes: ceph#521

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
Madhu-1 added a commit to Madhu-1/ceph-csi that referenced this issue Aug 29, 2023
Add design doc for QOS for rbd
devices mapped with both krbd
and rbd-nbd

closes: ceph#521

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
Madhu-1 added a commit to Madhu-1/ceph-csi that referenced this issue Aug 29, 2023
Add design doc for QOS for rbd
devices mapped with both krbd
and rbd-nbd

closes: ceph#521

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
Madhu-1 added a commit to Madhu-1/ceph-csi that referenced this issue Aug 29, 2023
Add design doc for QOS for rbd
devices mapped with both krbd
and rbd-nbd

closes: ceph#521

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
Madhu-1 added a commit to Madhu-1/ceph-csi that referenced this issue Aug 29, 2023
Add design doc for QOS for rbd
devices mapped with both krbd
and rbd-nbd

closes: ceph#521

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
Madhu-1 added a commit to Madhu-1/ceph-csi that referenced this issue Aug 29, 2023
Add design doc for QOS for rbd
devices mapped with both krbd
and rbd-nbd

closes: ceph#521

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
Madhu-1 added a commit to Madhu-1/ceph-csi that referenced this issue Aug 29, 2023
Add design doc for QoS for rbd
devices mapped with both krbd
and rbd-nbd

closes: ceph#521

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
Madhu-1 added a commit to Madhu-1/ceph-csi that referenced this issue Aug 29, 2023
Add design doc for QoS for rbd
devices mapped with both krbd
and rbd-nbd

closes: ceph#521

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
Madhu-1 added a commit to Madhu-1/ceph-csi that referenced this issue Sep 5, 2023
Add design doc for QoS for rbd
devices mapped with both krbd
and rbd-nbd

closes: ceph#521

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
Madhu-1 added a commit to Madhu-1/ceph-csi that referenced this issue Sep 5, 2023
Add design doc for QoS for rbd
devices mapped with both krbd
and rbd-nbd

closes: ceph#521

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
Madhu-1 added a commit to Madhu-1/ceph-csi that referenced this issue Sep 5, 2023
Add design doc for QoS for rbd
devices mapped with both krbd
and rbd-nbd

closes: ceph#521

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
Madhu-1 added a commit to Madhu-1/ceph-csi that referenced this issue Sep 5, 2023
Add design doc for QoS for rbd
devices mapped with both krbd
and rbd-nbd

closes: ceph#521

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
Madhu-1 added a commit to Madhu-1/ceph-csi that referenced this issue Sep 6, 2023
Add design doc for QoS for rbd
devices mapped with both krbd
and rbd-nbd

closes: ceph#521

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
Madhu-1 added a commit to Madhu-1/ceph-csi that referenced this issue Sep 6, 2023
Add design doc for QoS for rbd
devices mapped with both krbd
and rbd-nbd

closes: ceph#521

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
Madhu-1 added a commit to Madhu-1/ceph-csi that referenced this issue Sep 7, 2023
Add design doc for QoS for rbd
devices mapped with both krbd
and rbd-nbd

closes: ceph#521

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
@mergify mergify bot closed this as completed in #4089 Sep 7, 2023
mergify bot pushed a commit that referenced this issue Sep 7, 2023
Add design doc for QoS for rbd
devices mapped with both krbd
and rbd-nbd

closes: #521

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
openshift-cherrypick-robot pushed a commit to openshift-cherrypick-robot/ceph-csi that referenced this issue Oct 11, 2023
Add design doc for QoS for rbd
devices mapped with both krbd
and rbd-nbd

closes: ceph#521

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/rbd Issues related to RBD keepalive This label can be used to disable stale bot activiity in the repo
Projects
None yet
Development

Successfully merging a pull request may close this issue.