Table of Contents

Name

griller - kill old processes or procs on raising load

Synopsis

griller

Description

griller ist ein Prozess-Griller. It means that user processes which become too old will be barbecued (killed). A raising load will limit the allowed process age even more.

griller is designed to run forever. It scans every four seconds the /proc directory for processes to be killed. If it has trouble to start it exits with an appropriate return code as defined in sysexits.h.

griller doesn’t use any arguments or resource files. It reads some environment variables for its configuration.

KILL_LEVEL specifies the maximum process age in seconds which is allowed at load per one minute average of 1 ("load1"). Default when not set is 3600.
MINUID specifies the minimum user id of processes which may be grilled. Default is 500.
MAXUID specifies the minimum user id of processes which may be grilled. Default is 0 which means "off".
KILLING_OFF disables killing when set. In this case only logging will be done and processes that would be killed will be listed with "pseudokilling".
MAXLOADSOFT specifies the level of "load1" at which the maximum process age is calculated to be 0. If MAXLOADSOFT is reached by an UID then griller will start a new scan without sleeping.
MAXLOADHARD specifies the level of "load" above MAXLOADSOFT at which the scanning and killing of procs will be speed up internally.
PROCSOFTLIMIT specifies the number of processes of a single uid at which all processes of this uid only get a fourth of the time of KILL_LEVEL.
PROCHARDLIMIT specifies the number of processes of a single uid at which all processes of this uid will be immediately killed. If PROCHARDLIMIT is reached by an UID then griller will start a new scan without sleeping.

griller writes its logging and stats data to stdout. More explanation of the columns in logging output is done in lps(1) . The usage of tools like multilog (daemontools) is recommended. To run griller as a "background process" you may use something like daemonize or daemontools.

See Also

lps(1) , daemonize(1)

http://www.tuxad.de/

Examples

Example usage with daemontools:
$ ls -l /service/
lrwxrwxrwx 1 root root 12 Jul 3 10:58 griller -> /opt/griller
$ cat /opt/griller/run
#!/bin/bash
exec 2>&1
source /etc/grillfisch.d/griller.rc
exec /opt/griller/bin/griller
$ cat /opt/griller/log/run
#!/bin/sh
exec setuidgid griller multilog t s999999 n20 ./main
$ cat /etc/grillfisch.d/griller.rc
export KILL_LEVEL=1800
export MINUID=10000
export MAXUID=65533
unset KILLING_OFF
export MAXLOADSOFT=40
export MAXLOADHARD=60
export PROCSOFTLIMIT=15
export PROCHARDLIMIT=35

Author

Frank Bergmann, http://www.tuxad.com


Table of Contents