in reply to How to limit CPU utilization by ANY process with a perl script?

This shows how to do what you are asking for with cpulimits and a simple daemon written in shell. I would just use that, though porting it to Perl shouldn't be too hard if you really want to use Perl instead.
  • Comment on Re: How to limit CPU utilization by ANY process with a perl script?

Replies are listed 'Best First'.
Re^2: How to limit CPU utilization by ANY process with a perl script?
by MidLifeXis (Monsignor) on Feb 24, 2009 at 15:04 UTC

    The listed program appears to issue SIGCONT and SIGSTOP to the offending program. This can work, but it just seems messy. Additionally, the application can ignore those signals, correct?

    For a kludge, it seems like it would work. Having worked in academia, however, there are some percentage of users who will try to get around this. On the other hand, that is what the human side of policy is for (lock account, petition to have it reinstated, blah blah blah).

    I still contend that this belongs in the scheduler. That being said, however, if this functionality does not exist in the scheduler, then the suggested solution is reasonable.

    --MidLifeXis