Re: Asymmetric Module Init / Deinit
| From: | Scott MacVicar | Date: | Fri, 18 Jan 2008 10:25:30 +0000 |
| Subject: | Re: Asymmetric Module Init / Deinit | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-34829@lists.php.net to get a copy of this message | ||
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?
Scott
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