Look the following PHP code:
$start = time();
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://gmaxil.com');
curl_setopt($ch, CURLOPT_USERAGENT, 'Java/1.7.0_60');
curl_setopt($ch, CURLOPT_TIMEOUT, 2);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 2);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_exec($ch);
$end = time();
var_dump(curl_error($ch));
var_dump($end-$start);
curl_close($ch);
Running it on the local GAE environment (my machine), I get the following response (~2 seconds later):
string(43) "Resolving timed out after 2529 milliseconds" int(2)
Running it on GAE remote environment, I get the following response (~40 seconds later):
string(34) "Couldn't resolve host 'gmaxil.com'" int(40)
Why is Google App Engine ignoring the cURL timeout option?