You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by ALBERT HIDALGO BAREA <ab...@tid.es> on 2011/04/12 13:33:06 UTC

[users@httpd] Apache crashes under keep-alive test

Hi,

I am testing Apache HTTPD (2.2.17) with a benchmarking tool called Tsung.
Apache is running the default configuration files, in prefork mode.

The keep-alive is configured as follows:
Timeout                                             120
KeepAlive                                          On
MaxKeepAliveRequests              200
KeepAliveTimeout                         15

The MPM prefork is configured as follows:
<IfModule mpm_prefork_module>
    StartServers                                  8
    MinSpareServers                        5
    MaxSpareServers                       20
    ServerLimit                                    256
    MaxClients                                    256
    MaxRequestsPerChild              10000
</IfModule>

Tsung creates 800 clients, and every client makes 10 requests. Each request has a think time (meaning a waiting time between requests) of 5 seconds.

The problem is that Tsung stops making new requests and Apache says: [error] server reached MaxClients setting, consider raising the MaxClients setting
I tried to increase the ServerLimit and MaxClients directives, but it does not improve the test (or at least the numbers I tried). If I change the test to be done with HTTP 1.0, then the test is done perfectly, without any error. And if I reduce the waiting time between requests the test completes successfully.

There is some explanation to this problem? Lighttpd, Nginx, Cherokee and others work well with this test, without any error.
Thanks for the help.
Regards.
--
Albert Hidalgo


________________________________
Este mensaje se dirige exclusivamente a su destinatario. Puede consultar nuestra pol?tica de env?o y recepci?n de correo electr?nico en el enlace situado m?s abajo.
This message is intended exclusively for its addressee. We only send and receive email on the basis of the terms set out at.
http://www.tid.es/ES/PAGINAS/disclaimer.aspx

Re: [users@httpd] Apache crashes under keep-alive test

Posted by Ishita Kapadiya <is...@gmail.com>.
Try this settings -

1) <IfModule mpm_prefork_module>
   StartServers            20
   MinSpareServers     20
   MaxSpareServers     50
   ServerLimit         1000
   MaxClients          1000
   MaxRequestsPerChild 100000
</IfModule>

2) As Jim suggsted - Timeout should be maybe 10 and KeepAliveTimeout
maybe 3. increase MaxKeepAliveRequests to higher no. may be 600

3) Make sure Tsung is using keepalive aonncetions

Let's know how it goes?

On Tue, Apr 12, 2011 at 7:56 AM, ALBERT HIDALGO BAREA <ab...@tid.es> wrote:
> I tried different combination of the ServerLimit and MaxClients, as well as setting higher the timeout for keep-alive requests.
>
> <IfModule mpm_prefork_module>
>    StartServers        10
>    MinSpareServers     10
>    MaxSpareServers     20
>    ServerLimit         1000
>    MaxClients          1000
>    MaxRequestsPerChild 10000
> </IfModule>
>
> If I run "ps aux" I see a lot of httpd processes started, but when doing "top" I do not see any of those processes running for some seconds (but when running the same test but without keep-alive, or without any waiting time it displays some of the httpd processes).
>
> The error log file displays the next:
> [Tue Apr 12 13:51:22 2011] [error] server reached MaxClients setting, consider raising the MaxClients setting
>
> Thanks.
>
> -----Original Message-----
> From: Eric Covener [mailto:covener@gmail.com]
> Sent: martes, 12 de abril de 2011 13:38
> To: users@httpd.apache.org
> Subject: Re: [users@httpd] Apache crashes under keep-alive test
>
>> I tried to increase the ServerLimit and MaxClients directives, but it does
>> not improve the test (or at least the numbers I tried). If I change the test
>> to be done with HTTP 1.0, then the test is done perfectly, without any
>> error. And if I reduce the waiting time between requests the test completes
>> successfully.
>
> Post what you tried. The values you have are simply too small.
>
> ---------------------------------------------------------------------
> 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
>
>
> Este mensaje se dirige exclusivamente a su destinatario. Puede consultar nuestra política de envío y recepción de correo electrónico en el enlace situado más abajo.
> This message is intended exclusively for its addressee. We only send and receive email on the basis of the terms set out at.
> http://www.tid.es/ES/PAGINAS/disclaimer.aspx
>

---------------------------------------------------------------------
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] Apache crashes under keep-alive test

Posted by ALBERT HIDALGO BAREA <ab...@tid.es>.
I tried different combination of the ServerLimit and MaxClients, as well as setting higher the timeout for keep-alive requests.

<IfModule mpm_prefork_module>
    StartServers        10
    MinSpareServers     10
    MaxSpareServers     20
    ServerLimit         1000
    MaxClients          1000
    MaxRequestsPerChild 10000
</IfModule>

If I run "ps aux" I see a lot of httpd processes started, but when doing "top" I do not see any of those processes running for some seconds (but when running the same test but without keep-alive, or without any waiting time it displays some of the httpd processes).

The error log file displays the next:
[Tue Apr 12 13:51:22 2011] [error] server reached MaxClients setting, consider raising the MaxClients setting

Thanks.

-----Original Message-----
From: Eric Covener [mailto:covener@gmail.com]
Sent: martes, 12 de abril de 2011 13:38
To: users@httpd.apache.org
Subject: Re: [users@httpd] Apache crashes under keep-alive test

> I tried to increase the ServerLimit and MaxClients directives, but it does
> not improve the test (or at least the numbers I tried). If I change the test
> to be done with HTTP 1.0, then the test is done perfectly, without any
> error. And if I reduce the waiting time between requests the test completes
> successfully.

Post what you tried. The values you have are simply too small.

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


Este mensaje se dirige exclusivamente a su destinatario. Puede consultar nuestra política de envío y recepción de correo electrónico en el enlace situado más abajo.
This message is intended exclusively for its addressee. We only send and receive email on the basis of the terms set out at.
http://www.tid.es/ES/PAGINAS/disclaimer.aspx

Re: [users@httpd] Apache crashes under keep-alive test

Posted by Eric Covener <co...@gmail.com>.
> I tried to increase the ServerLimit and MaxClients directives, but it does
> not improve the test (or at least the numbers I tried). If I change the test
> to be done with HTTP 1.0, then the test is done perfectly, without any
> error. And if I reduce the waiting time between requests the test completes
> successfully.

Post what you tried. The values you have are simply too small.

---------------------------------------------------------------------
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] Apache crashes under keep-alive test

Posted by Jim Jagielski <ji...@apache.org>.
The timeout values (both Timeout:120 and KeepAliveTimeout:15)
are obscenely large. Timeout should be maybe 10 and KeepAliveTimeout
maybe 3 (if a persistent connection is coming, it will come quickly,
otherwise its best to put up with the overhead of socket teardown/
buildup rather than have an Apache process sitting around doing
nothing).

MaxRequestsPerChild:10000 is also low... should be 0.

Explanation for the problem: poor configuration.

On Apr 12, 2011, at 7:33 AM, ALBERT HIDALGO BAREA wrote:

> Hi,
>  
> I am testing Apache HTTPD (2.2.17) with a benchmarking tool called Tsung.
> Apache is running the default configuration files, in prefork mode.
>  
> The keep-alive is configured as follows:
> Timeout                                             120
> KeepAlive                                          On
> MaxKeepAliveRequests              200
> KeepAliveTimeout                         15
>  
> The MPM prefork is configured as follows:
> <IfModule mpm_prefork_module>
>     StartServers                                  8
>     MinSpareServers                        5
>     MaxSpareServers                       20
>     ServerLimit                                    256
>     MaxClients                                    256
>     MaxRequestsPerChild              10000
> </IfModule>
>  
> Tsung creates 800 clients, and every client makes 10 requests. Each request has a think time (meaning a waiting time between requests) of 5 seconds.
> 
> The problem is that Tsung stops making new requests and Apache says: [error] server reached MaxClients setting, consider raising the MaxClients setting
> I tried to increase the ServerLimit and MaxClients directives, but it does not improve the test (or at least the numbers I tried). If I change the test to be done with HTTP 1.0, then the test is done perfectly, without any error. And if I reduce the waiting time between requests the test completes successfully.
>  
> There is some explanation to this problem? Lighttpd, Nginx, Cherokee and others work well with this test, without any error.
> Thanks for the help.
> Regards.
> --
> Albert Hidalgo
>  
> 
> Este mensaje se dirige exclusivamente a su destinatario. Puede consultar nuestra política de envío y recepción de correo electrónico en el enlace situado más abajo.
> This message is intended exclusively for its addressee. We only send and receive email on the basis of the terms set out at.
> http://www.tid.es/ES/PAGINAS/disclaimer.aspx


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