Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

3 Answers 3

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

share|improve this answer

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

share|improve this answer
    
I can verify this timeout was set high enough. –  macinjosh Sep 24 '10 at 14:44

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.