We run a very busy web site, with php 5.6 on Debian VM, running a curl with this configuration:
$defaults = array(
CURLOPT_HEADER => 0,
CURLOPT_URL => $url,
CURLOPT_FRESH_CONNECT => 1,
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_FORBID_REUSE => 1,
CURLOPT_CONNECTTIMEOUT => 0.5,
CURLOPT_TIMEOUT => 2
);
We measure all the time the real duration, sometime we see "timeout" error (which is good), but sometime we measure a duration of more than 2 secondes ! (5 secondes).
I am wondering why curl is not respecting the timeout:
- Is it another option to configure timeout?
- very busy VM can cause this (I think about file-descriptors or i-nodes), curl could wait for this
- This is very impossible, and answer is somewhere else!