You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by alin vasile <al...@yahoo.com> on 2010/11/02 13:57:05 UTC

[users@httpd] MaxRequestsPerChild for worker mpm

Hi,

   We're noticing that the value provided for MaxRequestsPerChild is not picked 
up by httpd, but somehow the default value of 10,000 is used. We can see this 
because each request logs the pid and the request number that served it.

httpd: 2.2.15
mpm: prefork

Configuration:

KeepAlive On
KeepAliveTimeout 2
MaxKeepAliveRequests 100

<IfModule mpm_worker_module>
    ServerLimit          40 
    StartServers          5
    MaxClients          600
    MinSpareThreads      15
    MaxSpareThreads      30 
    ThreadsPerChild      15
    MaxRequestsPerChild  100000
</IfModule>

Regards,
Alin



      

---------------------------------------------------------------------
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] MaxRequestsPerChild for worker mpm

Posted by alin vasile <al...@yahoo.com>.
> It's actually max connections per child, but that makes your results> even more 
>wrong

Shouldn't getpid() return the pid of the child? I counted some pids in our log 
files and they have around the same number of occurences.

> Maybe they die due to MaxSpareThreads though.  Try setting it equal to> 
>MaxClients.

The load is constantly 30 hits per second. We have around 7 httpd processes 
 running, 2 of them remaining active since the server start, and the rest being 
restarted at each 10 minutes. Increasing the MaxRequestsPerChild to 10,000,000 
leads to the same behaviour, but this time 3 child processes are not being 
restarted.


----- Original Message ----
From: Eric Covener <co...@gmail.com>
To: users@httpd.apache.org
Sent: Tue, November 2, 2010 8:05:58 PM
Subject: Re: [users@httpd] MaxRequestsPerChild for worker mpm

On Tue, Nov 2, 2010 at 12:17 PM, alin vasile <al...@yahoo.com> wrote:
> After some debugging it proves that the configuration directive is correctly
> recognized by httpd. When we are logging the following variable in a module 
for
> each request :
>
>  char *id = apr_psprintf(r->pool, "%" APR_PID_T_FMT "-%d", getpid(),
> apr_atomic_inc32(&next_id));
>
> there are around 3- 4 thousands occurrences for each pid, below the max 
setting
> of 100,000.
>

It's actually max connections per child, but that makes your results
even more wrong.

>   MaxSpareThreads      30

Maybe they die due to MaxSpareThreads though.  Try setting it equal to
MaxClients.

>
>
>
> ----- Original Message ----
> From: alin vasile <al...@yahoo.com>
> To: users@httpd.apache.org
> Sent: Tue, November 2, 2010 5:18:56 PM
> Subject: Re: [users@httpd] MaxRequestsPerChild for worker mpm
>
> It is worker...
>
> ./httpd -l
> Compiled in modules:
>  core.c
>  mod_authn_file.c
>  mod_authn_default.c
>  mod_authz_host.c
>  mod_authz_groupfile.c
>  mod_authz_user.c
>  mod_authz_default.c
>  mod_auth_basic.c
>  mod_include.c
>  mod_filter.c
>  mod_log_config.c
>  mod_env.c
>  mod_setenvif.c
>  mod_version.c
>  worker.c
>  http_core.c
>  mod_mime.c
>  mod_status.c
>  mod_autoindex.c
>  mod_asis.c
>  mod_cgid.c
>  mod_negotiation.c
>  mod_dir.c
>  mod_actions.c
>  mod_userdir.c
>  mod_alias.c
>  mod_so.c
>
>
>
>
>
> ----- Original Message ----
> From: Tom Evans <te...@googlemail.com>
> To: users@httpd.apache.org
> Sent: Tue, November 2, 2010 5:05:16 PM
> Subject: Re: [users@httpd] MaxRequestsPerChild for worker mpm
>
> On Tue, Nov 2, 2010 at 1:10 PM, alin vasile <al...@yahoo.com> wrote:
>> sorry, my bad here. we are using the worker mpm.
>>
>
> Your original message said you were using prefork. httpd -l to confirm please.
>
> ---------------------------------------------------------------------
> 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
>
>
>
>
> ---------------------------------------------------------------------
> 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
>
>



-- 
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] MaxRequestsPerChild for worker mpm

Posted by Eric Covener <co...@gmail.com>.
On Tue, Nov 2, 2010 at 12:17 PM, alin vasile <al...@yahoo.com> wrote:
> After some debugging it proves that the configuration directive is correctly
> recognized by httpd. When we are logging the following variable in a module for
> each request :
>
>  char *id = apr_psprintf(r->pool, "%" APR_PID_T_FMT "-%d", getpid(),
> apr_atomic_inc32(&next_id));
>
> there are around 3- 4 thousands occurrences for each pid, below the max setting
> of 100,000.
>

It's actually max connections per child, but that makes your results
even more wrong.

>   MaxSpareThreads      30

Maybe they die due to MaxSpareThreads though.  Try setting it equal to
MaxClients.

>
>
>
> ----- Original Message ----
> From: alin vasile <al...@yahoo.com>
> To: users@httpd.apache.org
> Sent: Tue, November 2, 2010 5:18:56 PM
> Subject: Re: [users@httpd] MaxRequestsPerChild for worker mpm
>
> It is worker...
>
> ./httpd -l
> Compiled in modules:
>  core.c
>  mod_authn_file.c
>  mod_authn_default.c
>  mod_authz_host.c
>  mod_authz_groupfile.c
>  mod_authz_user.c
>  mod_authz_default.c
>  mod_auth_basic.c
>  mod_include.c
>  mod_filter.c
>  mod_log_config.c
>  mod_env.c
>  mod_setenvif.c
>  mod_version.c
>  worker.c
>  http_core.c
>  mod_mime.c
>  mod_status.c
>  mod_autoindex.c
>  mod_asis.c
>  mod_cgid.c
>  mod_negotiation.c
>  mod_dir.c
>  mod_actions.c
>  mod_userdir.c
>  mod_alias.c
>  mod_so.c
>
>
>
>
>
> ----- Original Message ----
> From: Tom Evans <te...@googlemail.com>
> To: users@httpd.apache.org
> Sent: Tue, November 2, 2010 5:05:16 PM
> Subject: Re: [users@httpd] MaxRequestsPerChild for worker mpm
>
> On Tue, Nov 2, 2010 at 1:10 PM, alin vasile <al...@yahoo.com> wrote:
>> sorry, my bad here. we are using the worker mpm.
>>
>
> Your original message said you were using prefork. httpd -l to confirm please.
>
> ---------------------------------------------------------------------
> 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
>
>
>
>
> ---------------------------------------------------------------------
> 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
>
>



-- 
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


Re: [users@httpd] MaxRequestsPerChild for worker mpm

Posted by alin vasile <al...@yahoo.com>.
After some debugging it proves that the configuration directive is correctly 
recognized by httpd. When we are logging the following variable in a module for 
each request :

 char *id = apr_psprintf(r->pool, "%" APR_PID_T_FMT "-%d", getpid(), 
apr_atomic_inc32(&next_id));

there are around 3- 4 thousands occurrences for each pid, below the max setting 
of 100,000. 




----- Original Message ----
From: alin vasile <al...@yahoo.com>
To: users@httpd.apache.org
Sent: Tue, November 2, 2010 5:18:56 PM
Subject: Re: [users@httpd] MaxRequestsPerChild for worker mpm

It is worker... 

./httpd -l
Compiled in modules:
  core.c
  mod_authn_file.c
  mod_authn_default.c
  mod_authz_host.c
  mod_authz_groupfile.c
  mod_authz_user.c
  mod_authz_default.c
  mod_auth_basic.c
  mod_include.c
  mod_filter.c
  mod_log_config.c
  mod_env.c
  mod_setenvif.c
  mod_version.c
  worker.c
  http_core.c
  mod_mime.c
  mod_status.c
  mod_autoindex.c
  mod_asis.c
  mod_cgid.c
  mod_negotiation.c
  mod_dir.c
  mod_actions.c
  mod_userdir.c
  mod_alias.c
  mod_so.c





----- Original Message ----
From: Tom Evans <te...@googlemail.com>
To: users@httpd.apache.org
Sent: Tue, November 2, 2010 5:05:16 PM
Subject: Re: [users@httpd] MaxRequestsPerChild for worker mpm

On Tue, Nov 2, 2010 at 1:10 PM, alin vasile <al...@yahoo.com> wrote:
> sorry, my bad here. we are using the worker mpm.
>

Your original message said you were using prefork. httpd -l to confirm please.

---------------------------------------------------------------------
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


      

---------------------------------------------------------------------
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] MaxRequestsPerChild for worker mpm

Posted by alin vasile <al...@yahoo.com>.
It is worker... 

./httpd -l
Compiled in modules:
  core.c
  mod_authn_file.c
  mod_authn_default.c
  mod_authz_host.c
  mod_authz_groupfile.c
  mod_authz_user.c
  mod_authz_default.c
  mod_auth_basic.c
  mod_include.c
  mod_filter.c
  mod_log_config.c
  mod_env.c
  mod_setenvif.c
  mod_version.c
  worker.c
  http_core.c
  mod_mime.c
  mod_status.c
  mod_autoindex.c
  mod_asis.c
  mod_cgid.c
  mod_negotiation.c
  mod_dir.c
  mod_actions.c
  mod_userdir.c
  mod_alias.c
  mod_so.c





----- Original Message ----
From: Tom Evans <te...@googlemail.com>
To: users@httpd.apache.org
Sent: Tue, November 2, 2010 5:05:16 PM
Subject: Re: [users@httpd] MaxRequestsPerChild for worker mpm

On Tue, Nov 2, 2010 at 1:10 PM, alin vasile <al...@yahoo.com> wrote:
> sorry, my bad here. we are using the worker mpm.
>

Your original message said you were using prefork. httpd -l to confirm please.

---------------------------------------------------------------------
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] MaxRequestsPerChild for worker mpm

Posted by Tom Evans <te...@googlemail.com>.
On Tue, Nov 2, 2010 at 1:10 PM, alin vasile <al...@yahoo.com> wrote:
> sorry, my bad here. we are using the worker mpm.
>

Your original message said you were using prefork. httpd -l to confirm please.

---------------------------------------------------------------------
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] MaxRequestsPerChild for worker mpm

Posted by alin vasile <al...@yahoo.com>.
sorry, my bad here. we are using the worker mpm.



----- Original Message ----
From: Eric Covener <co...@gmail.com>
To: users@httpd.apache.org
Sent: Tue, November 2, 2010 3:06:07 PM
Subject: Re: [users@httpd] MaxRequestsPerChild for worker mpm

On Tue, Nov 2, 2010 at 8:57 AM, alin vasile <al...@yahoo.com> wrote:
> Hi,
>
>   We're noticing that the value provided for MaxRequestsPerChild is not picked
> up by httpd, but somehow the default value of 10,000 is used.

> mpm: prefork

> <IfModule mpm_worker_module>
>    MaxRequestsPerChild  100000
> </IfModule>


ifModule is no-oping that stanza since you're not loading worker.

-- 
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] MaxRequestsPerChild for worker mpm

Posted by Eric Covener <co...@gmail.com>.
On Tue, Nov 2, 2010 at 8:57 AM, alin vasile <al...@yahoo.com> wrote:
> Hi,
>
>   We're noticing that the value provided for MaxRequestsPerChild is not picked
> up by httpd, but somehow the default value of 10,000 is used.

> mpm: prefork

> <IfModule mpm_worker_module>
>    MaxRequestsPerChild  100000
> </IfModule>


ifModule is no-oping that stanza since you're not loading worker.

-- 
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