0

I am a PHP developer and I just spent a good amount of time trying to track down a very strange problem the users of our web application were reporting. It turns out due to a slow API call over the internet (using cURL via PHP) Apache was timing out. I checked httpd.conf and the TimeOut directive was set to 12. I bumped it up to 120 for testing purposes and the problem went away!

When the time out would happen the user's browser would display an error similar to "The server dropped the connection." The error message changed depending on what browser was used and cURL would just say that the response from the server was empty. This behavior seems to make sense but I am bothered that Apache didn't log these timeouts or report any errors. Instead it just shutdown leaving us puzzled as to what was happening until we guessed it was a timeout.

Is there an option to log timeouts or some way we can monitor for this?

3 Answers 3

1

It was probably returning a 504 status code, which the browser interpreted as the above error message. Check your logs for that response code.

-1

I'd also verify CURLOPT_TIMEOUT is high enough to allow for what you're trying to do.

1
  • I can verify this timeout was set high enough.
    – joshwbrick
    Sep 24, 2010 at 14:44
-2

check out this little script if you want to monitor your apache. feel free to add some usefull calls like pa -A when it writes the log so you are able to see the situation more clear. http://www.triologic.eu/apache-monitor.0.html?&L=1

triologic.eu web team

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .