Is there a daemon that will kill any processes using above a specified % of CPU? I’m having issues where a system is sometimes grinding to a halt due to high CPU usage. I’m not sure what process is doing it (can’t htop as system is frozen); ideally I’d like a daemon that automatically kills processes using more than a given % of CPU, and then logs what process it was for me to look back on later. Alternatively something that just logs processes that use a given % of CPU so that I may look back on it after restarting the system.

The system is being used as a server so it’s unattended a lot of the time; it’s not a situation where I did something on the computer and then CPU usage went up.

Edit: Thanks to the comments pointing out it might be a memory leak instead of CPU usage that’s the issue. I’ve set up earlyoom which seems to have diagnosed the problem as a clamd memory leak. I’ve been running clamd on the server for ages without problems so might be the result of an update; I’ve disabled it for now, and will keep monitoring the situation to see if earlyoom catches anything else, or if the problem keeps occurring I’ll try some of the other tools people have suggested.

  • DigitalDilemma@lemmy.ml
    link
    fedilink
    English
    arrow-up
    14
    ·
    1 day ago

    Never heard of something like that, and I suspect anyone who started creating it soon filed it under “Really bad ideas” alongside “Whoops, why did my kernel just stop?”

    sar is the traditional way to watch for high load processes, but do the basics first as that’s not exactly trivial to get going. Things like running htop. Not only will that give you a simple breakdown of memory usage (others have already pointed out swap load which is very likely), but also sorting by cpu usage. htop is more than just a linux taskmgr, it’s a first step triage for stuff like this.