Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Automatically kill user processes hogging resources and notify them
New on LowEndTalk? Please Register and read our Community Rules.

Automatically kill user processes hogging resources and notify them

KassemKassem Member

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

  • edited November 7

    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.

  • MikeDVBMikeDVB Member, Host Rep

    @Kassem said:
    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.

    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

  • ralfralf Member

    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.

  • 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.

  • rustelekomrustelekom Member, Patron Provider

    It still works, but to be honest, the cgroups as stated above is more suitable due to many reason.

  • HxxxHxxx Member

    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.

Sign In or Register to comment.