Re: Do database resources sleep at night?
| From: | mlwmohawk at mohawksoft dot com | Date: | Tue, 02 Oct 2001 17:13:30 +0000 |
| Subject: | Re: Do database resources sleep at night? | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-67091@lists.php.net to get a copy of this message | ||
> Hello,
>
> I am writing a book on PHP with Andrei Zmievski and I asked him a
> question on how resources are handled and he suggested posting the
> question here.
>
>> >Hi Andrei,
>> >
>> >I am doing the 2nd database chapter and had some problems that I hope
>> >you can clarify:
>> >
>> >1. Are open resources (eg. database link_identifiers) automatically
> cleaned up
>> >when the page completes,
>> >or only when the apache child process dies?
>>
>> I *think* they hang around for as along as apache child lives, but you
>> may be better off asking Zeev or Andi about it.
>
> My suspicion is that persistent resources are only cleaned up when the
> child process dies, while non-persistent resources are closed
> immediately at the end of the page/script. Does anyone know the correct
> answer?
Oddly enough there is no such easy answer. In short it is up to the way the
extension is encoded.
To the point that I know, there is no periodic "clean-up" call that goes
out.
>
> If you can spare the time, I would be grateful for an answer to the
> following questions too:
>
> 2. If resources are not cleaned up until the apache child process dies,
> what will happen in multi-threaded servers like Apache 2 and IIS?
Good question.