New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Automatically kill user processes hogging resources and notify them
So on a shared system where multiple users have processes running. Is there a program that automatically kills user processes hogging resources and notifies the users?
So user x is using more memory total than defined y, their processes gets killed and they get sent an email with the processes that were killed and the amount of memory used.
Comments
Have you tried cgroups by any chance.
This should allow you to just limit them instead of allowing them to go over their limits, and then reacting to it.
The most popular solution I'm aware of is CloudLinux [LVE] which is based on cgroups / VZ but it's a paid solution.
You can certainly configure cgroups without paying anyone for anything but it's a bit more manual.
I believe ApisCP has built-in support for this and is fairly cheap [but not free] -> https://apiscp.com/ [ https://apiscp.com/features/athena ]
Any other alternatives besides cgroups or control panels?
If I understand this correctly, to setup email notifications when users reach limits, I have to write a C program?
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/resource_management_guide/sec-using_the_notification_api
There's also ulimit / cpulimit which you could probably fashion into a free solution. I haven't used either for a very long time though, so I'm rusty as to how.
You're probably looking for this.
https://www.rfxn.com/projects/process-resource-monitor/
Thanks @FatGrizzly! this indeed looks like it will do the job except per user notifications.
Last updated on Jan 19th 2014, hopefully it still works fine.
It still works, but to be honest, the cgroups as stated above is more suitable due to many reason.
Cloudlinux limits the user to their assigned resources. Maybe you could see if some kind of hook or trigger could be taken advantage of and trigger that email message.