-
Notifications
You must be signed in to change notification settings - Fork 44
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
DLPX-72326 Use OOMD instead of the kernel's OOM killer #297
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code change looks good, but I can't say one way or the other w.r.t. if this is safe to do.. assuming this works with other parts of our software, it LGTM.
Out of curiosity, how do you plan to handle deferred upgrade w.r.t. this change (or perhaps more accurately, w.r.t. changes that'll depend on cgroups v2)? E.g. I'm sure it requires a reboot to take advantage of cgroups v2.. so, will any changes we incorporate that require v2 be backwards compatible, such that it works with both v1 or v2, based on what's enabled on the system (e.g. if the customer rebooted after upgrade or not)? |
That's a great question! I believe that we wouldn't encounter any failures as OOMD only checks if cgroups v2 is supported to run (so we'll get no errors from it) BUT it won't actually detect anything as no resource on our kernel will be using cgroups v2. I'll need to figure this out. BTW I opened this as a draft to save my work and notes. This is kind of a side-project that's been slow-going. Keep in mind that we'd need to deal with the cgroups v2 change regardless as it will be the default in Ubuntu 21.04 and it will break our current OOM handler code. I'm not sure if we have a JIRA issue out yet for moving away from Ubuntu 18.04 but it would be nice if we could cross-reference that JIRA issue with this one. |
Yea, so it'd probably be "bad" if we switched entirely to using OOMD, and then had systems running v1 due to a deferred upgrade, but a silently nonfunctional OOMD, and also without our custom OOM handler (e.g. because we rip it out at the same time we add OOMD support).
Yea, understood.. and in that case, I'm not sure if we'd have to force a reboot or not.. but I'd be surprised if all of Ubuntu's software properly handled that v1 to v2 transition gracefully, in a deferred upgrade fashion.
IIRC, we have a current project to move from 18.04 to 20.04.. and if that transition will require a reboot upgrade, it'd probably be good to piggy back off that to migrate to cgroups v2, as that could alleviate some pain of later moving to 21.04 or future versions. |
Context:
Link: https://facebookmicrosites.github.io/oomd/
OOMD only works with 5.0+ kernels because it needs the PSI kernel interface (we should be good in terms of that) and cgroups V2 hierarchies (I think we are currently V1 so we may have to look into that). The proposal to use this is to overcome difficulties that we have with the current in-kernel OOM killer. Currently when a process dies by the OOM killer:
OOMD is very flexible and configurable. It can deal with all of the above by being configured to send SIGABRTs (and generate crash dumps) when processes take too much memory, take a system-wide memory snapshot before killing a process, and enforce per-process memory limits.
This Patch:
Enables CGROUPs v2 for the appstack by setting a kernel parameter during boot through GRUB.
Testing:
I created a VM and passed it that kernel parameter. The I manually checked that we had switched to cgroupsv2 by looking at the cgroup directory under sysfs.
= Before the patch:
= After the patch (
memory
directory is gone as it is unified under the top-levelcgroup
directory in v2):The only service that had a problem starting was our existing OOM service which we wrote with the assumption of using cgroups v1:
So I disabled it and run dx-test on that VM:
dx-test:
http://selfservice.jenkins.delphix.com/job/devops-gate/job/master/job/dx-integration-tests/23953/
the BB section of the above failed because of how I specified my VM
sd-bpf
instead ofsd-bpf.dcol2
so I re-run the BB part:http://selfservice.jenkins.delphix.com/job/devops-gate/job/master/job/blackbox-self-service/89831/
Future Work
I still need to:
docker
used by the vSDK project (cc: @nhlien93)