Hello, I've been enjoying the performance benefits of mod_perl, and appreciate the help of the contributors here.
Now I'm investigating why our production code is producing zombies. I'll post the key parts of my code below. First, some observations: 1. Zombies appear to be created only in a minority of the times the fork is made. 2. Restarting Apache seems to kill the zombies. I was under the impression that with a "true" zombie, an OS restart was required to kill zombies. Here's my code structure. It comes from a CGI::Application-based project using Apache::Registry. $SIG{CHLD} = 'IGNORE'; defined ($childpid = fork) or return $self->error( title => 'Technical Failure. ', msg => 'The search could not be completed due to a technical failure. ', ); unless ($childpid) { open STDIN, "</dev/null"; open STDOUT, ">/dev/null"; # break out a new DBI connection for use by the child my $DBH = $self->connect_db(undef, { dbi_connect_method => 'connect' }); $self->param('dbh', $DBH); eval { &my_long_running_operation; }; carp $@ if $@; CORE::exit(0); } ############################ I'm curious what possible causes are, or better alternatives for structuring the forking code. Below are my environment details. Thanks! Mark ###### modperl/1.29 Apache 1.3.31 $ perl -V Summary of my perl5 (revision 5.0 version 8 subversion 2) configuration: Platform: osname=freebsd, osvers=4.10-release, archname=i386-freebsd uname='freebsd my.secretservername.com 4.10-release freebsd 4.10-release #0: tue may 25 22:47:12 gmt 2004 [EMAIL PROTECTED]:usrobjusrsrcsysgeneric i386 ' config_args='-sde -Dprefix=/usr/local -Darchlib=/usr/local/lib/perl5/5.8.2/mach -Dprivlib=/usr/local/lib/perl5/5.8.2 -Dman3dir=/usr/local/lib/perl5/5.8.2/man/man3 -Dman1dir=/usr/local/man/man1 -Dsitearch=/usr/local/lib/perl5/site_perl/5.8.2/mach -Dsitelib=/usr/local/lib/perl5/site_perl/5.8.2 -Dscriptdir=/usr/local/bin -Ui_malloc -Ui_iconv -Uinstallusrbinperl -Dcc=cc -Doptimize=-O -pipe -Duseshrplib -Dccflags=-DAPPLLIB_EXP="/usr/local/lib/perl5/5.8.2/BSDPAN" -Ud_dosuid -Ui_gdbm -Dusethreads=n -Dusemymalloc=y' hint=recommended, useposix=true, d_sigaction=define usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef usemymalloc=y, bincompat5005=undef Compiler: cc='cc', ccflags ='-DAPPLLIB_EXP="/usr/local/lib/perl5/5.8.2/BSDPAN" -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -I/usr/local/include', optimize='-O -pipe ', cppflags='-DAPPLLIB_EXP="/usr/local/lib/perl5/5.8.2/BSDPAN" -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -I/usr/local/include' ccversion='', gccversion='2.95.4 20020320 [FreeBSD]', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=4, prototype=define Linker and Libraries: ld='cc', ldflags ='-Wl,-E -L/usr/local/lib' libpth=/usr/lib /usr/local/lib libs=-lm -lcrypt -lutil -lc perllibs=-lm -lcrypt -lutil -lc libc=, so=so, useshrplib=true, libperl=libperl.so gnulibc_version='' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' -Wl,-R/usr/local/lib/perl5/5.8.2/mach/CORE' cccdlflags='-DPIC -fPIC', lddlflags='-shared -L/usr/local/lib' Characteristics of this binary (from libperl): Compile-time options: USE_LARGE_FILES Built under freebsd Compiled at Aug 15 2004 09:43:23 @INC: /usr/local/lib/perl5/site_perl/5.8.2/mach /usr/local/lib/perl5/site_perl/5.8.2 /usr/local/lib/perl5/site_perl /usr/local/lib/perl5/5.8.2/BSDPAN /usr/local/lib/perl5/5.8.2/mach /usr/local/lib/perl5/5.8.2 . -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html