On Thu, Apr 04, 2013 at 11:48:46AM +0200, Jan-Frode Myklebust wrote:
> Probably also good to enable some debugging with:
> 
>       sudo -u sogo defaults write sogod SOGoDebugRequests YES
> 
> and see if the sogod.log tell you something..

We've often seen problems with sogod processes getting stuck, eating
cpu, so we've implemented a watchdog that kills sogod-processes
that's been using too much cputime.

Every 5 minutes we run the following script:


----8<-----8<------8<-------8<---8<----8<-------8<------8<-----8<--
#! /bin/sh -
#
# Kill sogo-processes that's been running too long.

too_long=15     # 00-59 minutes

ps -u sogo -opid,ppid,cputime | grep -v PPID | while read pid ppid time
do
        # Don't kill main daemon.
        if test "x$ppid" != "x1"
        then
                minutes=$(echo $time | cut -d: -f2)
                if test $minutes -gt $too_long;
                then
                        echo Killing $pid
                        ps -fp $pid
                        kill -9 $pid
                fi
        fi

done
----8<-----8<------8<-------8<---8<----8<-------8<------8<-----8<--

This hasn't been triggering often with sogo v2, but we've had situations
earlier where sogod would get stuck on unexpected data from the IMAP
server. F.ex. sogod didn't like dovecot telling it the progress during
IMAP searches and got stuck using 100% cpu whenever that happened.
        

  -jf
-- 
[email protected]
https://inverse.ca/sogo/lists

Reply via email to