severity 484349 wishlist
tag 484349 wontfix
thanks

Hi Folkert,

Folkert van Heusden wrote:
> cron: should have a load-limit making it not run when a certain load has 
> reached
> 
> e.g. when the load reaches 20, don't run anymore cron-jobs. this is
> helpfull if the system is already having a hard time due to a dos or so.

a general load limit is definitely out-of-the-question. To give you a
simple example why, suppose the administrator has a cron job that checks
the load every minute and sends out an alert if it reached 25. The
proposed solution would actually have become a problem.

Without going into any details, a "smarter" approach -- eg specifying
load limits per job -- would be too much of an effort.

A possible solution for the situation you describe would be to preceed
your commands with the following test (for a load of 20.00):

[ $(awk '{print $1}' /proc/loadavg | tr -d '.') -le 2000 ] || your-job


Christian

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to