You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Foo JH <jh...@extracktor.com> on 2007/05/24 14:19:13 UTC

Is it advisable NOT to limit MaxRequestsPerChild in Win32 modperl?

Hi all (my turn to ask modperl questions this time),

My persistent peeve with the Win32 Apache2.2 modperl is that it 
sometimes throws out this odd error:

[Mon Mar 05 21:19:47 2007] [notice] Parent: child process exited with 
status 3221225477 -- Restarting.

It's not very nice to have clients see an intermittent error when 
running the modperl app, so I'm trying a trick to see if this error can 
be minimised: by making modperl reload itself after x requests. This I 
accomplish by setting a small number (for testing) to 
MaxRequestsPerChild to see how modperl recovers from a reload.

Unfortunately at least on Win32, it does not.

I get this error when apache:
[Thu May 24 19:55:02 2007] [notice] Child 2404: Process exiting because 
it reached MaxRequestsPerChild. Signaling the parent to restart a new 
child process.
[Thu May 24 19:55:02 2007] [notice] Parent: Received restart signal -- 
Restarting the server.
[Thu May 24 19:55:02 2007] [notice] Apache/2.2.4 (Win32) mod_perl/2.0.3 
Perl/v5.8.8 configured -- resuming normal operations
[Thu May 24 19:55:02 2007] [notice] Server built: Jan  9 2007 23:17:20
[Thu May 24 19:55:02 2007] [crit] (22)Invalid argument: Parent: Failed 
to create the child process.
[Thu May 24 19:55:02 2007] [crit] (OS 6)The handle is invalid.  : 
master_main: create child process failed. Exiting.
[Thu May 24 19:55:02 2007] [notice] Parent: Forcing termination of child 
process 36
[Thu May 24 19:55:02 2007] [warn] (OS 995)The I/O operation has been 
aborted because of either a thread exit or an application request.  : 
winnt_accept: Asynchronous AcceptEx failed.
[Thu May 24 19:55:03 2007] [notice] Child 2404: Released the start mutex
[Thu May 24 19:55:03 2007] [notice] Child 2404: Waiting for 1 worker 
threads to exit.
[Thu May 24 19:55:05 2007] [notice] Child 2404: All worker threads have 
exited.
[Thu May 24 19:55:05 2007] [notice] Child 2404: Child process is exiting

Does anyone have any ideas if this can be resolved? Or is it a 'windows 
thing'?


Re: Is it advisable NOT to limit MaxRequestsPerChild in Win32 modperl?

Posted by Foo JH <jh...@extracktor.com>.
Perrin Harkins wrote:
> On 5/25/07, Lionel MARTIN <ma...@hotmail.com> wrote:
>> Unless I'm mistaken, and even if there is only one (child) Apache 
>> process
>> and several thread under Windows (winnt MPM), the only directive that 
>> can be
>> used is MaxRequestsPerChild  and not MaxRequestsPerThread.
>
> You're right, MaxThreadsPerlChild is available in other MPMs, but not
> the winnt one.
So...I'm screwed?


Re: Is it advisable NOT to limit MaxRequestsPerChild in Win32 modperl?

Posted by Perrin Harkins <pe...@elem.com>.
On 5/25/07, Lionel MARTIN <ma...@hotmail.com> wrote:
> Unless I'm mistaken, and even if there is only one (child) Apache process
> and several thread under Windows (winnt MPM), the only directive that can be
> used is MaxRequestsPerChild  and not MaxRequestsPerThread.

You're right, MaxThreadsPerlChild is available in other MPMs, but not
the winnt one.

- Perrin

Re: Is it advisable NOT to limit MaxRequestsPerChild in Win32 modperl?

Posted by Lionel MARTIN <ma...@hotmail.com>.
When developing for PHP, I'm using a colpletely different httpd.conf to 
start my server, and in this paeticular httpd.conf file, there's no mention 
about modperl, perl or whatever required libapreq.  The only modules I'm 
loading are:
mime_module
log_config_module
status_module
dir_module
php5_module

And the same error still happens again and again.

Everytime I'm reinstalling my development OS, I'm using a brand new version 
of 2.0.xx version of Apache (currently using 2.0.59) and I have to confess 
that this nasty problem you are talking about was not appearing in my 
previous Apache installations (2.0.55 if I remember well), or at least not 
that often.

As explained below, that's a real pity, because under Win32, a thread/child 
dying meamns the whole dying, and everything is forked again from the 
initial parent process.

If I had to use Win32 on a production server, I would either investigate 
more about this problem (writing to Apache Win32 porters or trying to study 
the souce code, (not easy when you are not used to) either...would avoid 
using it at all prices.

For now, you might perhaps give a look at previous Apache 2.0 versions and 
as well signal this bug to Apache Win32 porters. (are you subscribed to any 
Apache mailing list?)

Lionel.
----- Original Message ----- 
From: "Foo JH" <jh...@extracktor.com>
To: "Lionel MARTIN" <ma...@hotmail.com>
Cc: "Perrin Harkins" <pe...@elem.com>; <mo...@perl.apache.org>
Sent: Saturday, May 26, 2007 3:44 AM
Subject: Re: Is it advisable NOT to limit MaxRequestsPerChild in Win32 
modperl?


> Thanks Lionel,
>
> You meant when you dev. php, your apache did not load modperl at all, or 
> it's just not used? Will there be a performance enhancement (as in no 
> unexpected server restart) if you unload modperl totally?
>
> Yeah, that silly error page makes people unsure about Apache on Windows. A 
> real bummer.
>
> Lionel MARTIN wrote:
>> Hi,
>>
>> Actually I didn't see your original question, about the following error:
>> [Mon Mar 05 21:19:47 2007] [notice] Parent: child process exited with
>> status 3221225477 -- Restarting.
>>
>> Actually, I am not even sure that this is due to MP2.
>>
>> Indeed, on my development computer (running under Win XP, Apache/2.0.59), 
>> I am developing both PHP and Perl applications.
>> When developing for PHP, my Apache Server doesn't know about Mod Perl.
>>
>> And yet, I'm keeping having the error you have, time to time, when 
>> loading my PHP pages.
>>
>> Actually, the messages below are taken from my logs (Apache/2.0.59 and 
>> PHP 5.2.1)
>>
>> [Fri May 25 10:01:24 2007] [notice] Parent: child process exited with 
>> status 3221225477 -- Restarting.
>> [Fri May 25 10:01:24 2007] [notice] Apache/2.0.59 (Win32) PHP/5.2.1 
>> configured -- resuming normal operations
>> [Fri May 25 10:01:24 2007] [notice] Server built: Jul 27 2006 15:55:03
>> [Fri May 25 10:01:24 2007] [notice] Parent: Created child process 3828
>> [Fri May 25 10:01:24 2007] [notice] Child 3828: Child process is running
>> [Fri May 25 10:01:24 2007] [notice] Child 3828: Acquired the start mutex.
>> [Fri May 25 10:01:24 2007] [notice] Child 3828: Starting 64 worker 
>> threads.
>>
>> But that's quite transparent to the client, as it seems that after the 
>> restart, the page is served anyway. (but I get an ugly Windows error 
>> message box)
>>
>> So, I think the problems we are encountering are more due to Apache than 
>> to ModPerl.
>>
>> Lionel.
>>
>>
>>
>> ----- Original Message ----- From: "Foo JH" <jh...@extracktor.com>
>> To: "Lionel MARTIN" <ma...@hotmail.com>
>> Cc: "Perrin Harkins" <pe...@elem.com>; <mo...@perl.apache.org>
>> Sent: Friday, May 25, 2007 10:29 AM
>> Subject: Re: Is it advisable NOT to limit MaxRequestsPerChild in Win32 
>> modperl?
>>
>>
>>> Hello Perrin and Lionel,
>>>
>>> Lionel MARTIN wrote:
>>>> Unless I'm mistaken, and even if there is only one (child) Apache 
>>>> process and several thread under Windows (winnt MPM), the only 
>>>> directive that can be used is MaxRequestsPerChild  and not 
>>>> MaxRequestsPerThread.
>>>>
>>>> It is not possible to restart individual threads (and associated Perl 
>>>> Interpreteers), but only restart the child (which means restarting all 
>>>> the threads at once). So, basically, the value indicated by 
>>>> MaxRequestsPerChild is shared among all threads. (and its defaults 
>>>> value is 0, which means that your child is never restarted because of 
>>>> having handled too many requests).
>>> Makes sense. I've tried inserting:
>>> MaxRequestsPerThread 2
>>>
>>> to httpd.conf, but it complains that 'perhaps misspelled or defined by a 
>>> module not included in the configuration'. Which is quite true: I don't 
>>> see any <IfModule> tags for WinNT. Any suggestions?
>>>
>>>>
>>>> That's a bit of pity, because that's like an "all or nothing" 
>>>> behaviour, you can't kill individual threads because they are growing 
>>>> too much.
>>> I know. It's the curse of being a Windows developer. We're all screwed.
>>>
>>
>
> 


Re: Is it advisable NOT to limit MaxRequestsPerChild in Win32 modperl?

Posted by Foo JH <jh...@extracktor.com>.
Thanks Lionel,

You meant when you dev. php, your apache did not load modperl at all, or 
it's just not used? Will there be a performance enhancement (as in no 
unexpected server restart) if you unload modperl totally?

Yeah, that silly error page makes people unsure about Apache on Windows. 
A real bummer.

Lionel MARTIN wrote:
> Hi,
>
> Actually I didn't see your original question, about the following error:
> [Mon Mar 05 21:19:47 2007] [notice] Parent: child process exited with
> status 3221225477 -- Restarting.
>
> Actually, I am not even sure that this is due to MP2.
>
> Indeed, on my development computer (running under Win XP, 
> Apache/2.0.59), I am developing both PHP and Perl applications.
> When developing for PHP, my Apache Server doesn't know about Mod Perl.
>
> And yet, I'm keeping having the error you have, time to time, when 
> loading my PHP pages.
>
> Actually, the messages below are taken from my logs (Apache/2.0.59 and 
> PHP 5.2.1)
>
> [Fri May 25 10:01:24 2007] [notice] Parent: child process exited with 
> status 3221225477 -- Restarting.
> [Fri May 25 10:01:24 2007] [notice] Apache/2.0.59 (Win32) PHP/5.2.1 
> configured -- resuming normal operations
> [Fri May 25 10:01:24 2007] [notice] Server built: Jul 27 2006 15:55:03
> [Fri May 25 10:01:24 2007] [notice] Parent: Created child process 3828
> [Fri May 25 10:01:24 2007] [notice] Child 3828: Child process is running
> [Fri May 25 10:01:24 2007] [notice] Child 3828: Acquired the start mutex.
> [Fri May 25 10:01:24 2007] [notice] Child 3828: Starting 64 worker 
> threads.
>
> But that's quite transparent to the client, as it seems that after the 
> restart, the page is served anyway. (but I get an ugly Windows error 
> message box)
>
> So, I think the problems we are encountering are more due to Apache 
> than to ModPerl.
>
> Lionel.
>
>
>
> ----- Original Message ----- From: "Foo JH" <jh...@extracktor.com>
> To: "Lionel MARTIN" <ma...@hotmail.com>
> Cc: "Perrin Harkins" <pe...@elem.com>; <mo...@perl.apache.org>
> Sent: Friday, May 25, 2007 10:29 AM
> Subject: Re: Is it advisable NOT to limit MaxRequestsPerChild in Win32 
> modperl?
>
>
>> Hello Perrin and Lionel,
>>
>> Lionel MARTIN wrote:
>>> Unless I'm mistaken, and even if there is only one (child) Apache 
>>> process and several thread under Windows (winnt MPM), the only 
>>> directive that can be used is MaxRequestsPerChild  and not 
>>> MaxRequestsPerThread.
>>>
>>> It is not possible to restart individual threads (and associated 
>>> Perl Interpreteers), but only restart the child (which means 
>>> restarting all the threads at once). So, basically, the value 
>>> indicated by MaxRequestsPerChild is shared among all threads. (and 
>>> its defaults value is 0, which means that your child is never 
>>> restarted because of having handled too many requests).
>> Makes sense. I've tried inserting:
>> MaxRequestsPerThread 2
>>
>> to httpd.conf, but it complains that 'perhaps misspelled or defined 
>> by a module not included in the configuration'. Which is quite true: 
>> I don't see any <IfModule> tags for WinNT. Any suggestions?
>>
>>>
>>> That's a bit of pity, because that's like an "all or nothing" 
>>> behaviour, you can't kill individual threads because they are 
>>> growing too much.
>> I know. It's the curse of being a Windows developer. We're all screwed.
>>
>


Re: Is it advisable NOT to limit MaxRequestsPerChild in Win32 modperl?

Posted by Lionel MARTIN <ma...@hotmail.com>.
Hi,

Actually I didn't see your original question, about the following error:
[Mon Mar 05 21:19:47 2007] [notice] Parent: child process exited with
status 3221225477 -- Restarting.

Actually, I am not even sure that this is due to MP2.

Indeed, on my development computer (running under Win XP, Apache/2.0.59), I 
am developing both PHP and Perl applications.
When developing for PHP, my Apache Server doesn't know about Mod Perl.

And yet, I'm keeping having the error you have, time to time, when loading 
my PHP pages.

Actually, the messages below are taken from my logs (Apache/2.0.59 and PHP 
5.2.1)

[Fri May 25 10:01:24 2007] [notice] Parent: child process exited with status 
3221225477 -- Restarting.
[Fri May 25 10:01:24 2007] [notice] Apache/2.0.59 (Win32) PHP/5.2.1 
configured -- resuming normal operations
[Fri May 25 10:01:24 2007] [notice] Server built: Jul 27 2006 15:55:03
[Fri May 25 10:01:24 2007] [notice] Parent: Created child process 3828
[Fri May 25 10:01:24 2007] [notice] Child 3828: Child process is running
[Fri May 25 10:01:24 2007] [notice] Child 3828: Acquired the start mutex.
[Fri May 25 10:01:24 2007] [notice] Child 3828: Starting 64 worker threads.

But that's quite transparent to the client, as it seems that after the 
restart, the page is served anyway. (but I get an ugly Windows error message 
box)

So, I think the problems we are encountering are more due to Apache than to 
ModPerl.

Lionel.



----- Original Message ----- 
From: "Foo JH" <jh...@extracktor.com>
To: "Lionel MARTIN" <ma...@hotmail.com>
Cc: "Perrin Harkins" <pe...@elem.com>; <mo...@perl.apache.org>
Sent: Friday, May 25, 2007 10:29 AM
Subject: Re: Is it advisable NOT to limit MaxRequestsPerChild in Win32 
modperl?


> Hello Perrin and Lionel,
>
> Lionel MARTIN wrote:
>> Unless I'm mistaken, and even if there is only one (child) Apache process 
>> and several thread under Windows (winnt MPM), the only directive that can 
>> be used is MaxRequestsPerChild  and not MaxRequestsPerThread.
>>
>> It is not possible to restart individual threads (and associated Perl 
>> Interpreteers), but only restart the child (which means restarting all 
>> the threads at once). So, basically, the value indicated by 
>> MaxRequestsPerChild is shared among all threads. (and its defaults value 
>> is 0, which means that your child is never restarted because of having 
>> handled too many requests).
> Makes sense. I've tried inserting:
> MaxRequestsPerThread 2
>
> to httpd.conf, but it complains that 'perhaps misspelled or defined by a 
> module not included in the configuration'. Which is quite true: I don't 
> see any <IfModule> tags for WinNT. Any suggestions?
>
>>
>> That's a bit of pity, because that's like an "all or nothing" behaviour, 
>> you can't kill individual threads because they are growing too much.
> I know. It's the curse of being a Windows developer. We're all screwed.
> 


Re: Is it advisable NOT to limit MaxRequestsPerChild in Win32 modperl?

Posted by Foo JH <jh...@extracktor.com>.
Hello Perrin and Lionel,

Lionel MARTIN wrote:
> Unless I'm mistaken, and even if there is only one (child) Apache 
> process and several thread under Windows (winnt MPM), the only 
> directive that can be used is MaxRequestsPerChild  and not 
> MaxRequestsPerThread.
>
> It is not possible to restart individual threads (and associated Perl 
> Interpreteers), but only restart the child (which means restarting all 
> the threads at once). So, basically, the value indicated by 
> MaxRequestsPerChild is shared among all threads. (and its defaults 
> value is 0, which means that your child is never restarted because of 
> having handled too many requests).
Makes sense. I've tried inserting:
MaxRequestsPerThread 2

to httpd.conf, but it complains that 'perhaps misspelled or defined by a 
module not included in the configuration'. Which is quite true: I don't 
see any <IfModule> tags for WinNT. Any suggestions?

>
> That's a bit of pity, because that's like an "all or nothing" 
> behaviour, you can't kill individual threads because they are growing 
> too much.
I know. It's the curse of being a Windows developer. We're all screwed.

Re: Is it advisable NOT to limit MaxRequestsPerChild in Win32 modperl?

Posted by Lionel MARTIN <ma...@hotmail.com>.
Unless I'm mistaken, and even if there is only one (child) Apache process 
and several thread under Windows (winnt MPM), the only directive that can be 
used is MaxRequestsPerChild  and not MaxRequestsPerThread.

It is not possible to restart individual threads (and associated Perl 
Interpreteers), but only restart the child (which means restarting all the 
threads at once). So, basically, the value indicated by MaxRequestsPerChild 
is shared among all threads. (and its defaults value is 0, which means that 
your child is never restarted because of having handled too many requests).

That's a bit of pity, because that's like an "all or nothing" behaviour, you 
can't kill individual threads because they are growing too much.

Lionel.

----- Original Message ----- 
From: "Perrin Harkins" <pe...@elem.com>
To: "Foo JH" <jh...@extracktor.com>
Cc: <mo...@perl.apache.org>
Sent: Friday, May 25, 2007 7:05 AM
Subject: Re: Is it advisable NOT to limit MaxRequestsPerChild in Win32 
modperl?


> On 5/24/07, Foo JH <jh...@extracktor.com> wrote:
>> This I
>> accomplish by setting a small number (for testing) to
>> MaxRequestsPerChild to see how modperl recovers from a reload.
>
> I think you're looking for MaxRequestsPerThread.  There is only one
> process on the Windows MPM.
>
> - Perrin
> 


Re: Is it advisable NOT to limit MaxRequestsPerChild in Win32 modperl?

Posted by Perrin Harkins <pe...@elem.com>.
On 5/24/07, Foo JH <jh...@extracktor.com> wrote:
> This I
> accomplish by setting a small number (for testing) to
> MaxRequestsPerChild to see how modperl recovers from a reload.

I think you're looking for MaxRequestsPerThread.  There is only one
process on the Windows MPM.

- Perrin