-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
RFC: Notifications/actions before systemd-oomd kills #23606
Comments
I assume we are talking about a system wide warning (rather than a cgroup specific one)? And, I guess oomd needs to fire it because user applications do not have access to the configuration to estimate whether kills are imminent? Right now we have a |
I've also seen related requests -- to tell the application memory is running low and it should reduce its memory consumption (think of custom allocators in java or browsers). The natural answer would be -- just watch PSI in your cgroup and act based on that. In a more generic sense, I considered issuing a DBus signal from oomd based on available info -- I learn now that's effectively what To the |
Just dropping this as examples of why notifications prior to killing a cgroup... Applications just disappear. If I don't restart daily, it randomly just kills a process, some with drastic effects (killing gnome-shell, Nautilus, gnome-terminal).
|
We already have a GLib API that uses low-memory-monitor's D-Bus API, and portal support for Flatpak. The API is also implemented on Windows through Windows native calls. The D-Bus API is simple, and extensible: The simplest would be for systemd-oomd to implement that D-Bus interface, while owning the Changing the D-Bus API to use another name or another path would require changing GIO, xdg-desktop-portal and python-dbusmock, at least. |
I see this is still open.
Here's the system performance graph running at the time. Machine is x86_64. No virtualization. 32GB RAM, 2GB swap. rustc 1.74.0 (79e9716c9 2023-11-13) |
Not sure if this doesn't classify as a separate (bug) report.
I assume the resource graphs cover the moment of the unxpected kill somewhere after the CPU peaks. (And that those >5h CPU time includes multiple compiles out of the captured window.) Are you sure there is no memory limit configured in any of the |
Yes, that's the compute blip in the middle of the graph.
I dunno. Ubuntu puts a huge amount of stuff in those directories, none of which I ever touched. This is a desktop system, and it's not acting as a server at all.
john@user-desktop:/sys/fs/cgroup/user.slice/user-1001.slice$
3TB rotating hard drive. Can anything else use it in concurrently with troublesome builds?
|
We've had some discussions offline about customers who are interested in a pre-kill notifications and also pre-kill hooks to run certain things before systemd-oomd kills a process. Starting this issue to track the discussions in one place.
For pre-kill hooks, we discussed the possibility of a generic design where we define a socket for data processing and it goes away when the unit is OOM killed. Apparently this is similar to systemd-coredump. We also discussed using different signals to tell the service that an OOM kill is about to happen, but this is less flexible.
For pre-kill notifications I think we had discussed using dbus to detect the state changes. But I'm not sure what kind of hook up the desktop folks want. Or what kind of settings we need to configure when the notification would send. If possible we should try to tie this in with the pre-kill hooks above and get one generic solution.
@michel-slm @benzea @msekletar
The text was updated successfully, but these errors were encountered: