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

Change Controller concurrency defaults based on available CPU #1473

Open
clux opened this issue Apr 20, 2024 · 0 comments
Open

Change Controller concurrency defaults based on available CPU #1473

clux opened this issue Apr 20, 2024 · 0 comments
Labels
question Direction unclear; possibly a bug, possibly could be improved. runtime controller runtime related

Comments

@clux
Copy link
Member

clux commented Apr 20, 2024

Would you like to work on this feature?

yes

What problem are you trying to solve?

Am writing a doc on scaling controllers and realising there's a footgun in the default unlimited concurrency implemented by controller::Config, unlimited is great until you start having heavy load and THEN it starts breaking (as you hit apiserver limits via throttling, memory limits via OOMs).

Describe the solution you'd like

It is probably better if by default we make this dial use a default based on how much CPU is given to the pod running the controller.

This can be done by doing a multiple of the value received form num_cpus::get for instance (which reads cgroup limits). Maybe a default with a minimum of 2 or 4 would be good? Normally folloing num cores exactly is not great since we usually use way less than that for most controllers.

Solutions from the GO world allow accomplishing the same thing by injecting evars:
https://blog.howardjohn.info/posts/gomaxprocs/

It would be nicer to do this by default.

Describe alternatives you've considered

  • maintain unlimited
  • default 1 concurrency (feels sluggish in most cases)

Documentation, Adoption, Migration Strategy

must be noted in releases and kube.rs docs

Target crate for feature

kube-runtime

@clux clux added runtime controller runtime related unstable feature that unstable feature gating question Direction unclear; possibly a bug, possibly could be improved. and removed unstable feature that unstable feature gating labels Apr 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Direction unclear; possibly a bug, possibly could be improved. runtime controller runtime related
Projects
None yet
Development

No branches or pull requests

1 participant