FREE THOUGHT · FREE SOFTWARE · FREE WORLD

DreamHost ProcWatch

#############################################################################
# This file is automatically generated by Procwatch service. Do not modify. #
#############################################################################
$CPU_LIMIT_PER_PROC = 50;
$CPU_LIMIT_PER_USER = 75;
$FCGI_MEM_LIMIT_PER_USER = 200;
$IDEAL_LOAD = 2.0;
$MEM_LIMIT_PER_USER = 100;
$PROC_LIMIT_PER_USER = 25;

# DEFAULT CONFIG!  these values get overridden by /dh/etc/procwatch/procwatch.conf
my $POLL_INTERVAL = 30; # amount to pass to sleep()
my $CPU_LIMIT_PER_PROC = 50; # amount of CPU usage allowed per proc, 50 = 50%
my $CPU_LIMIT_PER_USER = 75; # ...allowed per user
my $MEM_LIMIT_PER_USER = 100; # megs of RAM allowed per user
my $FCGI_MEM_LIMIT_PER_USER = 200; # higher RAM ceiling for fcgi procs
my $PROC_LIMIT_PER_USER = 25; # number of concurrent procs allowed per user
my $PROC_MIN_RUN_TIME = 0.00; # grace period in seconds, proc must be scheduled for this many CPU seconds before being killed
my $THREAD_DIFFERENCE = 10; # procs must be started this number of jiffies apart or less to be considered "threaded."

# load-sensitive settings
my $IDEAL_LOAD = 2.0; # procwatch will not kill or renice ANY procs under this load

# filenames!
my $PROCWATCH_LOGFILE = '/var/log/procwatch.log';
my $CONFIG_FILE = '/dh/etc/procwatch/procwatch.conf';
my $IGNORE_USERS_FILE = '/dh/etc/procwatch/ignore_users';
my $IGNORE_PROCS_FILE = '/dh/etc/procwatch/ignore_procs';

# exemptions
my @EXEMPT_USERS = qw(root daemon nobody postfix dhapache jabber); # users to ignore, additional users added by /ndn/etc/procwatch/ignore_users
my @EXEMPT_PROCS = qw(sshd bash csh zsh tcsh); # procs to ignore, additional procs added by /ndn/etc/procwatch/ignore_procs
my @FCGI_PROCS = qw(dispatch.fcgi ruby ruby1.8 trac.fcgi); # various names that fcgi procs might go under

# nice/renice config stuff
my $ACCOUNTING_RATE = 1.0; # normal rate to apply to CPU usage..  1.0 == normal
my $NICE_RATE = 0.5; # rate for niced procs..  0.5 == half
my $REQUIRED_NICE_LEVEL = 19; # nice must be >= this to qualify for the discount
my $RENICE_STEP = 19; # amount to renice procs per step..  +19 is the default

# STRINGS!
my $REASON_PROCESS_OVER_CPU_LIMIT = "Process over CPU limit";
my $REASON_USER_OVER_CPU_LIMIT = "Process puts user over total CPU limit";
my $REASON_USER_OVER_MEM_LIMIT = "Process puts user over total memory limit";
my $REASON_USER_OVER_PROC_LIMIT = "Process puts user over total allowed processes";
my $REASON_FCGI_OVER_MEM_LIMIT = "Ruby process would have put user over normal memory limit";
my $REASON_USER_OVER_FCGI_MEM_LIMIT = "Ruby process puts user over the fcgi memory limit";
my $REASON_LOW_LOAD = "Machine load under $IDEAL_LOAD";

# cat procwatch/procwatch2.conf
; Default procwatch settings - DON'T MODIFY THIS FILE LOCALLY!
; Make temporary changes in procwatch2-local.conf, or set a
; user or machine parameter to make them permanent.

[types]
procwatch = str
procwatch.interval = float
procwatch.localconf = list
exempt = list
exempt.belowUid = int
messages = str
userNotification = str

[procwatch]
; Polling interval (seconds)
interval = 10

; File to write logs to
logFile = /var/log/procwatch.log

; File to write a PID to when daemonizing
pidFile = /var/run/procwatch.pid

[exempt]
; Processes with EUIDs below this are ignored completely
belowUid = 1000

; Users and process names to ignore most of the time
; (except in panic mode, at which point anything goes!)
; Note that local additions go in procwatch-local.conf
users = nobody
procs = sshd bash ksh csh tcsh zsh

; Processes to give extra RAM to (see cpu.bonusMultiplier et al)
bonusRAM = dispatch.fcgi ruby ruby1.8 trac.fcgi rsync
superBonusRAM = gem cpan cc c++ cc1 cc1plus gcc g++

[cpu]
; Maximum percentage of a single CPU's time used by any one process
perProcMax = 50
perUserMax = 75

; Minimum nice to qualify for the discount
; "nice cmd" gives +10, so it's a good threshold
niceLevel = 10

; Treat niced processes as this fraction of a normal process
; when accounting for CPU
niceMultiplier = 0.5

; Amount of niceness to add to processes that are eating CPU
niceStep = 15

[ram]
; Limit on per-user total RSS, in kilobytes
perUserMax = 102400

; Per-process cap on virtual memory mappings. Note that this is *HIGHER* than
; perUserMax, as this also counts memory-mapped files (as well as libraries).
; Killing processes which memory-map files is bad, unless they're really
; mapping gobs and gobs of stuff!
absoluteMax = 1572864

; Multiply RAM usage by this factor for processes that get "bonus RAM"
; (under "exempt")
bonusMultiplier = 0.5
superBonusMultiplier = 0.3

; Percentage of inactive RAM (not cache/buffer/free) at which we PANIC
; and start killing RAM-hungry processes left and right!
panicLevel = 5

[proc]
; Maximum processes for any user. Pretty straightforward.
perUserMax = 25

[messages]
; Messages to display *INTERNALLY*
processOverRAM = virtual memory
userOverCPU = CPU time
userOverRAM = total RAM
userOverProc = process count
oomPanic = out of memory panic kill

[userNotification]
; Messages sent to user's shell
format = Yikes! One of your processes (%(command)s, pid %(pid)d) was just killed %(reason)s If you believe you've received this message in error, please contact Support.

; ansi formats to use (1 = bold, 33 = yellow)
color = 1;33m

; Substituted in for reason. Make sure to not be too specific...
generic = because it violated an unspecified resource limitation.
processOverRAM = for exceeding limits on virtual memory usage.
userOverCPU = because your processes are, as a whole, consuming too much processor time.
userOverRAM = because your processes are, as a whole, consuming too much memory.
userOverProc = because you are running too many processes.
oomPanic = because the server is out of memory and we have to take drastic measures to try to get things under control.
age = because it has been running for over a week.

; vim: set syn=dosini:

Hosting DreamHost Out of memory RAM virtual memory

 

 

Comments