I have a runaway ruby process - I know exactly how I trigger it.

Point is, it got me thinking about runaway processes (CPU usage or memory usage).

  • How would one monitor runaway processes with cron? grep / top / ulimit?

  • Can one notify the user via the
    command line if something like this

  • What alternatives are there to Monit?


Instead of writing a script yourself you could use the verynice utility. Its main focus is on dynamic process renicing but it also has the option to kill runaway processes and is easily configured.


The more conventional way to do this would be by imposing hard limits via ulimit -- it can even stop a forkbomb. As Marcel Stimberg said, verynice is a similar utility but focuses solely on nice value rather than, say, limiting memory usage which was included in your question.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.