Well I’m a fairly experienced web developer trying to create a http monitor script. Now I’ve built it, and the script runs every 5 minutes. It uses curl to perform a simple http request on a defined url however every now and then I get one of the two different errors (both the same but just a difference with the bytes received).
Operation timed out with 0 out of -1 bytes received
Operation timed out with 55 out of -1 bytes received
It happens about every 1 or 2 times an hour. So lets see the code:
$server = server_details($server_id);
i wrote a similar thing, but with netcat.. made things a lot simpler!
curl_setopt($ch, CURLOPT_TIMEOUT, 10); // times out after 10s
try upping the timeout? it might be that the webserver just happens to be busy at that particular time? up it to 60 seconds for say 6 hours and see if you still get those timeouts. im guessing the flaw in my argument is that you see the log of it actually getting the file... how much data does it transfer on a successful transfer?
id make it throw up an error only if several sequential checks fail, or x fail in y period of time - less chance to throw up an error due to network probs etc