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

Epic: Enable overcommit #517

Open
2 tasks
vadim2404 opened this issue Sep 4, 2023 · 4 comments
Open
2 tasks

Epic: Enable overcommit #517

vadim2404 opened this issue Sep 4, 2023 · 4 comments
Assignees
Labels
t/Epic Issue type: Epic t/feature Issue type: feature, for new features or requests

Comments

@vadim2404
Copy link

vadim2404 commented Sep 4, 2023

Motivation

Look at the image:

Resource Requested Used
CPU 121 6
RAM 457 53

image

Let's have at least 2x overcommit (because of the maximum number of pods that can be up and running)

DoD

Implementation ideas

TODO

Tasks

Tasks

Other related tasks, Epics, and links

@sharnoff
Copy link
Member

Here's some design ideas I've considered. I believe the 3rd solution is probably the best one.

1. Implement exclusively within k8s scheduler plugin

Idea: Change the scheduler plugin so that it actually allows resource usage from

Good parts:

  • Only requires changes in one component; other components don't need to know about it

Bad parts:

  • If usage from regular pods fills up a node, the base scheduler + cluster-autoscaler will still interpret that correctly.
  • May have strange consequences with cluster-autoscaler being overly willing to scale up, because its internal scheduler simulation is less permissive than our plugin
  • Setting would be global, increasing risk of volatility during rollout or revert

2. Implement within neonvm-controller/neonvm-runner

Idea: When a VM is set to a certain amount of memory and/or CPU, we actually set QEMU to use some fixed multiple of that

Good parts:

  • Has no effect on scheduler or cluster-autoscaler

Bad parts:

  • Regular pods unaffected
  • Counterintuitive (e.g. "why does setting it to 3 CPUs actually give it 6?")
  • Will have knock-on effects on autoscaler-agent's scaling; it must be made aware of this global overcommit factor (even though it's not possible to atomically deploy changes to multiple components)
  • Requires restart or migration of all VMs in order to get updated neonvm-runner pods
  • Setting would be global, increasing risk of volatility during rollout or revert

3. Implement via "overcommit" factor per VM

Idea: Add a new VM setting determining an "overcommit" factor that both the scheduler and cluster-autoscaler respect. Kind of a combination of ideas 1 and 2, but per-VM rather than global.

Good parts:

  • Rollout is gradual, does not require restarting any VMs

Bad parts:

@stradig
Copy link
Contributor

stradig commented Apr 9, 2024

We discussed this today and decided to start increasing the overcommit factor gradually over the course of the next few weeks by .1 increments. We will observe if there are any negative effects and probably ramp up to 1.5, only. For more we will prioritize neondatabase/cloud#14114 as a prerequisite to allow for faster reaction in case of node failures.

@sharnoff
Copy link
Member

Made an initial implementation in #905, still need to test it and self-review. Opened a handful of other PRs while I was poking around in the area:

@sharnoff
Copy link
Member

Status: #936 is waiting on my response to review, then will need to create new PR rebasing #905 onto #936.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t/Epic Issue type: Epic t/feature Issue type: feature, for new features or requests
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants