Mobile app version of vmapp.org
Login or Join
Harper822

: Understanding the apache Timeout value I'm trying to understand the timeout value in apache since I want to make my server run very fast. On my local server, I tried using an apache timeout

@Harper822

Posted in: #Apache #Timeout

I'm trying to understand the timeout value in apache since I want to make my server run very fast. On my local server, I tried using an apache timeout of 5 seconds. I then attempted to execute the following PHP code as an actual script.

<?php
echo "EXEC...";
sleep(12);
echo "EXEC OK";
echo time();
?>


As expected it took time to load, but the script finished after 12 seconds as instructed in the script code, however the apache timeout is 5 seconds. This doesn't make sense.

So then I thought if the timeout value didn't stop my script from executing completely, then I should be able to get away with setting the timeout to maybe even 3 seconds at most considering the connection time to my site is well under one second. I think I can safely assume that 99.9% of the people requesting my site will be able to have it completely loaded in one second.

Is there anything I should watch out for before setting the timeout value to a couple seconds?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Harper822

1 Comments

Sorted by latest first Latest Oldest Best

 

@Berumen354

From httpd.apache.org/docs/2.0/mod/core.html#timeout
The Apache timeout directive defines the amount of time Apache will wait to receive a get request, or the amount of time between receipt of the TCP packets on PUT and POST requests, the time between receipt of ACK's on the transmission of TCP packets in response.

Put another way using your test you never hit the limit as the even though you put a sleep in place in the code TCP packets where still being sent and received between the server and the browser.

As an example the default timeout setting for Apache is 300 seconds and this is more than ample for most configurations.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme