You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Matty Ronald <ma...@gmail.com> on 2010/07/13 06:33:42 UTC

[users@httpd] When and how does the parent pid get notified that it is time for the child to die because MaxRequestsPerChild has been reached?

Hi All,

Can anyone help me Why parent httpd process isn't spawning a new
replacement child in a timely fashion, after MaxRequestsPerChild has
been hit and the child worker httpd has exited.

When and how does the parent pid get notified that it is time for the
child to die because MaxRequestsPerChild has been reached?

Does the child send back to the parent that it is servicing it's last
client BEFORE it starts doing so or does the parent in some way keep
track of how many clients the child has serviced or what?




Thanks
Matty.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] When and how does the parent pid get notified that it is time for the child to die because MaxRequestsPerChild has been reached?

Posted by Joost de Heer <jo...@sanguis.xs4all.nl>.
On Tue, August 3, 2010 13:59, Matty Ronald wrote:
> Hi,
>
> Parent httpd process isn't spawning a new replacement child in a timely
> fashion,
> after MaxRequestsPerChild has been hit and the child worker httpd has
> exited with the below settings:
>
> Timeout 70
> KeepAlive On
> KeepAliveTimeout 60
>
> <IfModule mpm_worker_module>
>     StartServers          2
>     MaxClients          150
>     MinSpareThreads      25
>     MaxSpareThreads      75
>     ThreadsPerChild      25
>     MaxRequestsPerChild   10000
> </IfModule>

If no new child is started, then there are at least 25 threads available
(MinSpareThreads), so no new child needs to be started.

Joost

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] When and how does the parent pid get notified that it is time for the child to die because MaxRequestsPerChild has been reached?

Posted by Matty Ronald <ma...@gmail.com>.
Hi,

Parent httpd process isn't spawning a new replacement child in a timely fashion,
after MaxRequestsPerChild has been hit and the child worker httpd has
exited with the below settings:

Timeout 70
KeepAlive On
KeepAliveTimeout 60

<IfModule mpm_worker_module>
    StartServers          2
    MaxClients          150
    MinSpareThreads      25
    MaxSpareThreads      75
    ThreadsPerChild      25
    MaxRequestsPerChild   10000
</IfModule>

Please let me know if any modifications required in httpd.conf file
settings to create new child process

Thanks & Regards,
matty

On 7/13/10, Eric Covener <co...@gmail.com> wrote:
> On Tue, Jul 13, 2010 at 12:33 AM, Matty Ronald <ma...@gmail.com> wrote:
>> Hi All,
>>
>> Can anyone help me Why parent httpd process isn't spawning a new
>> replacement child in a timely fashion, after MaxRequestsPerChild has
>> been hit and the child worker httpd has exited.
>>
>
> The parent doesn't necessarily have to replace a child that exits due
> to MaxRequestsPerChild, if you're not below MinSpareThreads.
>
>> When and how does the parent pid get notified that it is time for the
>> child to die because MaxRequestsPerChild has been reached?
>
> The child offs itself, and the parent both checks every second to see
> if a child has exited and knows which indvidual threads are still
> running and which have exited, so it can keep track of Min/Max
> SpareThreads.
>
>> Does the child send back to the parent that it is servicing it's last
>> client BEFORE it starts doing so or does the parent in some way keep
>> track of how many clients the child has serviced or what?
>
> All the bookeeping is in the child. The parent only tells the child
> it's time to exit for MaxSpareThreads (children can't figure that out
> on their own) and restarts.
>
> --
> Eric Covener
> covener@gmail.com
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] When and how does the parent pid get notified that it is time for the child to die because MaxRequestsPerChild has been reached?

Posted by Eric Covener <co...@gmail.com>.
On Tue, Jul 13, 2010 at 12:33 AM, Matty Ronald <ma...@gmail.com> wrote:
> Hi All,
>
> Can anyone help me Why parent httpd process isn't spawning a new
> replacement child in a timely fashion, after MaxRequestsPerChild has
> been hit and the child worker httpd has exited.
>

The parent doesn't necessarily have to replace a child that exits due
to MaxRequestsPerChild, if you're not below MinSpareThreads.

> When and how does the parent pid get notified that it is time for the
> child to die because MaxRequestsPerChild has been reached?

The child offs itself, and the parent both checks every second to see
if a child has exited and knows which indvidual threads are still
running and which have exited, so it can keep track of Min/Max
SpareThreads.

> Does the child send back to the parent that it is servicing it's last
> client BEFORE it starts doing so or does the parent in some way keep
> track of how many clients the child has serviced or what?

All the bookeeping is in the child. The parent only tells the child
it's time to exit for MaxSpareThreads (children can't figure that out
on their own) and restarts.

-- 
Eric Covener
covener@gmail.com

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org