Am 17.03.2014 08:31, schrieb Paul J Stevens:
> On 16-03-14 15:35, Reindl Harald wrote:
> 
>> hah i generalized mine last night too :-)
>>
>> i fear the timeouts i showed recently with pop3d growing over a longer
>> run are a different problem, AFAIk i never seen dbmail-pop3d consume
>> that much CPU, no idea what that is, why that grows over time and how
>> top debug that :-(
> 
> Harrie, your script contains a bug. It shouldn't grep for 'pool' since
> that only applies to imapd

indeed, fixed

i have the strace / lsof / netstat / mysqladmin parts of our first
debug try for the imap-loop still there as comments, who knows :-)
____________________________________

#!/bin/bash
rm -f dbmail-debug-*.txt

PNAME=${1:-dbmail-imapd}
MAXCPU=${2:-20}
PID=`pidof $PNAME`
[ -n "$PID" ] || { echo "Error: Unable to determine main process ID for 
$PNAME"; exit 1; }

# lsof -n > dbmail-debug-lsof.txt
# netstat -anlp > dbmail-debug-netstat.txt
# mysqladmin -u root -p extended-status > dbmail-debug-mysql-extended.txt
# mysqladmin -u root -p processlist > dbmail-debug-mysql-processlist.txt

# THREAD_IDS=`ls /proc/$PID/task`
# for THREAD_ID in $THREAD_IDS
# do
#  strace -v -p $THREAD_ID 2>> "dbmail-debug-strace-$THREAD_ID.txt" >> 
"dbmail-debug-strace-$THREAD_ID.txt" &
# done

echo "generate backtrace for $PNAME($PID) with CPU > $MAXCPU"
BUSY=`top -H -b -n1 -p $PID|grep -E "${PNAME}|pool"| awk '{if ($9 > $MAXCPU) 
print $1}'`
[ -n "$BUSY" ] || exit 0
tmpfile=`mktemp`
echo 'bt' > $tmpfile
for TID in $BUSY; do
 gdb --batch -x $tmpfile -p $TID > dbmail-debug-backtrace.$TID.txt
 echo "backtrace for $PNAME in " dbmail-debug-backtrace.$TID.txt
done
rm -f $tmpfile

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
DBmail mailing list
[email protected]
http://mailman.fastxs.nl/cgi-bin/mailman/listinfo/dbmail

Reply via email to