On 1/18/08, Scott MacVicar <[EMAIL PROTECTED]> wrote: > Apache children get killed and re-spawned after the number of requests > defined by MaxRequestsPerChild, the default is 10,000. Though MINI > talways get called for each child spawned. > > Is Apache using pre-fork or worker?
Pre-fork. That's weird. I set MaxRequestPerChild to 100, ran ab -n 500 url and I can see workers being destroyed and created but I only see MINIT being called once on startup. As workers exit I see MSHUTDOWN but no corresponding MINIT. Just to be sure my log apparatus wasn't setup yet I wrote a message to stderr, flushed it and verified that it's in the Apache error_log. I'm pretty sure MINIT gets called on startup and MSHUTDOWN gets called every time a child exits. I used stock Apache 2.2.6 and PHP 5.2.5 with the standard Apache 2 build instructions [1] (although I did not compile php --with-mysql) on x86_64-redhat-linux. Mike [1] http://www.php.net/manual/en/install.unix.apache2.php > Michael B Allen wrote: > > I have someone using my extension who is seeing some strange behavior > > where the module initializes which Apache starts, the extension works > > perfectly and then, without warning, after about 40 seconds, the > > deinitialization routine runs. This kills some state in a global > > context and everything goes very badly from there. Otherwise, Apache > > is still running just fine. > > > > The setup is Apache 2.2 / PHP 5.2 on Fedora 7. > > > > I personally have not been able to replicate this problem but I'm > > thinking it must be an Apache worker exiting that's triggering deinit. > > I know Apache 1.x has that behavior and I'm wondering if anyone knows > > if 2.2 exhibits that behavior. It's annoying because it means that the > > module initialization is called once whereas the deinitialization > > routine is called many times. > > > > Does this sound familiar to anyone? > > > > I would appreciate any insight as to how I can ensure that my module > > is deinitialized only once. My first thought is to simply save the pid > > of the process that initialized the module and check for it in the > > deinitialization routine. > > > > Mike > > > -- Michael B Allen PHP Active Directory SPNEGO SSO http://www.ioplex.com/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php