I am using a proprietary, 3rd party Drupal module that queries a 3rd party service via curl. The service has been a bit flakey lately, which is slowing my page loads a lot and when I've got a lot of traffic I am hitting max_connections.
The information that this extension queries is not vital, but it is important enough that I can't just remove the module. For the time being, I fixed it by patching the module to add a curl timeout to the request:
curl_setopt($ch, CURLOPT_TIMEOUT, 1);
However, I don't want to leave the hack in place because it'll disappear on the next update and since the problem is intermittent it won't show up in testing.
Is there any way to set the timeout globally in a php.ini setting or in PHP via code (that I could drop in a custom module)?
Any help is appreciated,
Thanks