-
Notifications
You must be signed in to change notification settings - Fork 21
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
neonvm: Fractional CPU limiting inside the VM #1052
Draft
sharnoff
wants to merge
2
commits into
main
Choose a base branch
from
sharnoff/neonvm-internal-cpu-limiting
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
More specifically, with this change: 1. There is a new cgroup inside the VM, /neonvm-root 2. There are associated cgroup & mount namespaces such that when inside those namespaces, /neonvm-root appears to be the root cgroup 3. All 'command's from the image spec are run inside the /neonvm-root cgroup and associated namespaces In order to support the creation of new cgroups inside /neonvm-root (like what's used in the test images, or in neondatabase/neon), we have to run normal processes in a separate /neonvm-root/leaf cgroup in order to not voilate the "no internal processes" rule.[1] But other than that, most things should continue to behave as normal. For example, cgconfigparser (which we use to set up user cgroups) appears to continue to work just fine. Also worth noting: Currently sshd also runs in the same cgroup & namespaces as everything else, so that it continues to match the perspective of processes running inside the VM. When running as root, it's possible to break out of the namespaces by entering PID 1's namespaces: nsenter --target=1 --cgroup --mount <command...> [1]: https://man7.org/linux/man-pages/man7/cgroups.7.html
todo: - Implement the backend in neonvm-daemon - Fix build-test-vm needing access to neonvm-daemon (how to get it?) - Add iptables rules inside the VM to prevent access to neonvm-daemon - Figure out why scripts/run-bench.sh has 0.1x TPS at 0.25 CPU...
sharnoff
force-pushed
the
sharnoff/neonvm-internal-cpu-limiting
branch
from
September 25, 2024 01:03
3e7f580
to
6fbc3e2
Compare
Merging this branch will increase overall coverage
Coverage by fileChanged files (no unit tests)
Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code. HTML Report |
mikhail-sakhnov
added a commit
that referenced
this pull request
Oct 14, 2024
Extracted the minimal version from #1052, because it's clear that this daemon is required in multiple places, and we don't know which PR will merge first. --- **Notes:** Not expected to pass CI! (images won't be in the right place). Haven't tested it since extracting from #1052. cc @mikhail-sakhnov, as discussed :) --------- Signed-off-by: Misha Sakhnov <[email protected]> Co-authored-by: Misha Sakhnov <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Decided to push the branch I'd made, for discussion. Not necessarily going this route, pending a couple RFCs.