On Monday 28 July 2003 11:11, Brian Candler wrote:
> On Mon, Jul 28, 2003 at 10:31:34AM -0400, Jesse Guardiani wrote:
> > Is there a way to debug things like this and figure out what is
> > causing the hang? Can I run something like ktrace on an already
> > running process?
>
> ktrace -p <pid>

Ah. Don't know how I missed that...


>
> does the trick nicely. 'ktrace -C' then stops tracing systemwide, a good
> thing to have handy if tracing a process in an infinite loop :-)
>
> Did you get a chance to do a 'top' or 'ps' to show it's actually a
> sqwebmail process at fault?

Absolutely. I had to kill sqwebmail, after all. And, like I said, this has been
happening for months. I've had plenty of time to look at top, but until
today I haven't know what to do about it.

I'll definately ktrace the next one.


>
> > Can I somehow compile sqwebmail with
> > debugging code so that I can trace the sqwebmail process when
> > a CPU hog appears?
>
> I don't think so, since I can't see how to distinguish 'CPU hog' from
> 'normal process doing a lot of work'. You can perhaps attach gdb to a
> running process, but I've not got to that stage yet.
>
> > I get sqwebmail CPU hogs every few days on my server, so I'd really
> > like to figure out what the problem is. My box is a FreeBSD 4.8-
> > RELEASE box. And I've been experiencing these sqwebmail hangs
> > for months now. And I'm not even running FastCGI. :)
>
> sqwebmail does fork some child processes: gzip, and the banner program if
> you're using that.

Not using bannerprog yet, but I am configuring with gzip. I'm going to let
another "CPU hog" appear and run ktrace -p on it. Then I may configure
without gzip.

BTW, here's my configure, just in case you're interested:

   ./configure --enable-https=auto --enable-softtimeout=1800 \
                --with-maxargsize=10000000 \
                --with-maxformargsize=10000000 --with-trashquota \
                --without-authpwd --without-authshadow \
                --without-authpam --without-authuserdb \
                --without-authmysql --without-authpgsql \
                --without-authldap --without-authdaemon \
                --with-authvchkpw --enable-webpass=yes \
                --enable-cgibindir=/usr/local/apache/cgi-bin

I don't explicitly enable gzip, but I think configure is autodetecting it since I have:

GZIP = /usr/bin/gzip

in my sqwebmail/Makefile


>
> You might like to try 'configure --without-gzip' and see if that helps. At
> the moment I'm running sqwebmail configured with FastCGI (and therefore
> without-gzip), but running it as a normal CGI because of the FastCGI
> problems. I don't see any CPU hogs, and it's a moderately active server
> (about 400K impressions yesterday, about 65K of which are CGI and the rest
> are images/stylesheets)
>
> Cheers,
>
> Brian.

Thanks!

-- 
Jesse Guardiani, Systems Administrator
WingNET Internet Services,
P.O. Box 2605 // Cleveland, TN 37320-2605
423-559-LINK (v)  423-559-5145 (f)
http://www.wingnet.net



Reply via email to