David Scott wrote:
I've built Apache 2.2.3 and mod_perl 2.0.3 with libapreq 2.08 and the worker MPM. There appears to be some kind of race condition at startup that prevents the server from coming up. This only happens once in a while, and can be fixed by some minor configuration or code change (ie, adding a 'print STDERR "foobar\n"' to one of my Perl modules can cause the problem to occur; moving the print statement by one line can fix it).
This sounds like a possible issue with your code and threaded perl. It doesn't ring a bell as a general mod_perl issue.
I've been porting a fairly complex pure-Perl legacy application from mod_perl 1 to mod_perl 2. The reason we're trying this is because memory requirements in MP1 are horrendous and child process death is extremely expensive.
Do you realize that it will take MORE memory when run with threads? If you want to keep memory down, use the prefork MPM. See the list archives for discussion about memory and Perl threads. Also, threads slow down startup since a lot of work has to be done when spawning them to copy all the data structures for each one.
In addition, it's not unusual for the mod_perl 1 server to take a long time to start up or shut down.
Slow startup on mod_perl 1 usually means you are compiling a lot of code or doing some other time-consuming thing in your startup code, like maybe talking to a database.
Does anyone have suggestions on how I can track down the problem?
I'd start by switching to prefork and seeing if it's still there. If it is, the most reliable method is to take things out until the problem goes away. It's not instant gratification, but it works.
- Perrin