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

Add support for cgroup v2 in Pulsar Loadbalancer #16601

Closed
lhotari opened this issue Jul 14, 2022 · 8 comments · Fixed by datastax/pulsar#188
Closed

Add support for cgroup v2 in Pulsar Loadbalancer #16601

lhotari opened this issue Jul 14, 2022 · 8 comments · Fixed by datastax/pulsar#188
Labels
Stale type/feature The PR added a new feature or issue requested a new feature

Comments

@lhotari
Copy link
Member

lhotari commented Jul 14, 2022

Is your feature request related to a problem? Please describe.

The Pulsar loadbalancer detects CPU limits using cgroup v1 API.
Newer Kubernetes runtimes support cgroup v2 and popular Linux distributions are migrating to use cgroup v2 as the default option.

https://kubernetes.io/docs/setup/production-environment/container-runtimes/#cgroup-v2

https://kubernetes.io/docs/concepts/architecture/cgroups/

"Cgroup v2 is the next version of the cgroup Linux API. Differently than cgroup v1, there is a single hierarchy instead of a different one for each controller."

Describe the solution you'd like

The Pulsar loadbalancer should also support cgroup v2.

Additional context

LinuxInfoUtils class currently supports only cgroup v1

@lhotari lhotari added the type/feature The PR added a new feature or issue requested a new feature label Jul 14, 2022
@lhotari lhotari changed the title Add support for cgroups v2 in Pulsar Loadbalancer Add support for cgroup v2 in Pulsar Loadbalancer Jul 14, 2022
@lhotari
Copy link
Member Author

lhotari commented Jul 15, 2022

Java 11 is getting cgroup v2 support in 11.0.16 with https://bugs.openjdk.org/browse/JDK-8230305 changes. It seems that Java 17 already supports cgroup v2.

@github-actions
Copy link

The issue had no activity for 30 days, mark with Stale label.

@github-actions github-actions bot added the Stale label Aug 15, 2022
@lhotari
Copy link
Member Author

lhotari commented Apr 8, 2023

It looks like Kubernetes 1.25.2+ defaults to cgroups v2 based on https://twitter.com/brunoborges/status/1644413308571721750?t=YLdUH-DamtbgA43dLCBbdw&s=19 and Azure/AKS#3443 . See https://kubernetes.io/blog/2022/08/31/cgroupv2-ga-1-25/ .
Pulsar load balancer doesn't balance memory consumption in that case since it doesn't support cgroups V2.
/Cc @nicoloboschi @michaeljmarshall

@lhotari
Copy link
Member Author

lhotari commented Apr 8, 2023

" AKS Kubernetes 1.25+ uses cgroups v2."
https://github.com/Azure/AKS/releases/tag/2023-03-05

@lhotari
Copy link
Member Author

lhotari commented Apr 26, 2023

GKE seems to have a way to select between cgroup v1 & cgroup v2:
https://cloud.google.com/kubernetes-engine/docs/how-to/node-system-config#cgroup-mode-options

GKE will default to cgroup v2 in new Kubernetes 1.26 clusters or node pools. Based on the doc, I would assume that upgraded clusters / node pools would continue to use cgroup v1 in GKE. However this is something that needs verification.

@lhotari
Copy link
Member Author

lhotari commented Apr 26, 2023

AWS EKS v1.26 nodes will default to cgroup v2 based on this comment: awslabs/amazon-eks-ami#824 (comment)

@lhotari
Copy link
Member Author

lhotari commented May 5, 2023

Resolved by #16832

@lhotari
Copy link
Member Author

lhotari commented Jun 27, 2023

there's a backport to branch-2.10 in #20659

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Stale type/feature The PR added a new feature or issue requested a new feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant