views:

275

answers:

1

I am getting a peculiar problem. Apache closes connection after 12 seconds or so. This leads to a "connection reset by peer" message on the browser.

I am on Linux Centos 5. Using apache2/php5.x/mod_gzip. (php with eAccelerator)

I tested some variations:

  • Usually, I will print all the HTML output as the last step. It always closes connection when the processing time goes above 12 seconds.
  • If the print happens quicker ( < 12 secs ), connection is not closed and I get the page on the browser.
  • If I print something regularly (every second or so), the connection is not closed even if the processing time goes above 12 secs.

What could be the possible issue here? Any suggestions on fixing this issue?

Edit - More details:

  • apache access-log shows status code is 200.
  • TimeOut directive is set. Timeout value is set at 60.
  • php.ini: max_execution_time is set at 30 secs.
  • client and server on different machines. It is a direct connection (no proxies in between Edit2: The ISP routes all requests through its proxy.).
  • Apache is standalone.
+3  A: 

On the software side,

  • What status code is logged in access.log?
  • Do you (per-chance) have a Timeout directive in your httpd.conf (or inside any other files that may be included from httpd.conf)?
  • What is max_execution_time configured to be in php.ini?
  • Is your Apache being used as a reverse-proxy, or is it stand-alone?

On the network side,

  • Are the server and your client (browser PC) on the same machine, or is there a proxy, firewall or router in-between?
vladr
Hi Vlad, details added to the Question.
sleepy
Thanks Vlad,It seems the ISP proxy is the culprit.I tried from the server machine and also a different machine (on different ISP). It works without issue.Thank you..
sleepy