From bb47ba94c3805634385dccd4f18dc004a9abcb99 Mon Sep 17 00:00:00 2001 From: Nicolas Vigier Date: Tue, 9 Aug 2011 09:07:38 +0000 Subject: add script to kill viewvc.fcgi processes using more than 1G of memory --- modules/viewvc/templates/kill_viewvc.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 modules/viewvc/templates/kill_viewvc.sh (limited to 'modules') diff --git a/modules/viewvc/templates/kill_viewvc.sh b/modules/viewvc/templates/kill_viewvc.sh new file mode 100755 index 00000000..4c27d3f3 --- /dev/null +++ b/modules/viewvc/templates/kill_viewvc.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +max_memory=1000000 + +for process in `pgrep viewvc.fcgi` +do + process_mem=$(pmap "$process" | grep total | sed 's/ \+total \+\([[:digit:]]\+\)K/\1/') + if [ "$process_mem" -gt "$max_memory" ] + then + kill -15 "$process" + fi +done + -- cgit v1.2.1