httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeroen Geilman <jer...@adaptr.nl>
Subject Re: [users@httpd] What does Timeout in the httpd.conf file accomplish?
Date Mon, 20 Jun 2011 00:46:44 GMT
On 06/20/2011 02:38 AM, Zaccone, Warren wrote:
>
> Runningmultiple copies of this script concurrently brings httpd into a 
> hang state, that it will not recover from without manually restarting 
> the httpd server.
>
> ab-n 300 -c 300 http://myserver/mysite/loop.php
>

You're requesting a single URL 300 times concurrently.
This means that apache has to dedicate 300 threads at once to this purpose.

If you're not running worker, and your minspare is lower than 250 or so, 
it's going to take MINUTES to even get to number 300.

As documented, when many new (prefork) threads are being requested at 
once, apache will only  spawn one per second, to protect itself from 
attacks and runaway processes.


> <?php
>
> /* loop.php */
>
> while (1) sleep (20);
>
> ?>
>

And the request does nothing for 20 seconds before returning.

What exactly are you testing here ?


> I have timeout set to 900 but it does not appear to be working.What 
> does timeout in the httpd.conf do?
>


As documented, Timeout determines the maximum number of seconds that a 
single request may take.


> Will the httpd.conf  timeout protect the server from such scripts or  
> is there something else.
>

Yes, Timeout works on the HTTP level, so everything sent over HTTP is 
affected by it.

This means everything.


> I am configured using Prefork
>

Then that apachebench run you show above is bloody stupid.

> settings are:
>
> Timeout 900
>
> MaxKeepAliveRequests 100
>
> StartServers5
>
> MinSpareServers5
>
> MaxSpareServers10
>
> MaxClients256
>


You can't even SERVE 300 concurrent requests.


> MaxRequestsPerChild  0
>

If you run PHP, this kills apache.
Eventually.

> # pstack 22040 (root)
>

You have no idea what you are doing.


-- 
J.


Mime
View raw message