On 16-03-14 15:02, James Greig wrote:
> Hi,
> 
> Completely appreciate that by me just saying it "won't work" isn't helpful :) 
> 
> Ok.  Top in freebsd doesn't have -n1 and -p  so the next thing I did was move 
> to just using ps
> 
> [root@mail4-db-4a ~]# ps Hlauxc -p `pidof dbmail-pop3d`
>   UID   PID PPID CPU PRI NI    VSZ   RSS MWCHAN STAT TT     TIME COMMAND      
> USER    %CPU %MEM STARTED
> 65534 74473    1   0 103  0 139116 57488 -      R    ??  1:33.86 dbmail-pop3d 
> nobody 100.0  0.2  1:17PM
> 65534 74473    1   0  20  0 139116 57488 uwait  I    ??  0:00.00 dbmail-pop3d 
> nobody   0.0  0.2  1:17PM
> 
> As you can see that's the output and you can also see 100.0% CPU at the 
> moment.
> 
> Am I just awk'in out the normal PID there?

The idea is to attach the gdb to the busy thread/pid, generate a bt and
get an idea of where in the code the thread is looping.

On linux each thread/fork gets it's own PID, but apparently on FBSD
things are different.

I just generalised the backtrace script to work for both imapd and other
processes.

By default it will look for busy threads on imapd, but you can tweak the
behavior:

dumpbt.sh dbmail-pop3d 60

will look for pop3d processes eating up more than 60% cpu and generate a
bt for them

Alas it only works for linux.

http://git.dbmail.eu/paul/dbmail/tree/test-scripts/dumpbt.sh

If Harald suffers from the same problem on linux, maybe he can run this
and get a handle on the problem.



-- 
________________________________________________________________
Paul J Stevens       pjstevns @ gmail, twitter, github, linkedin
           www.nfg.nl/[email protected]/+31.85.877.99.97
_______________________________________________
DBmail mailing list
[email protected]
http://mailman.fastxs.nl/cgi-bin/mailman/listinfo/dbmail

Reply via email to