Manual:$wgHTTPConnectTimeout

Details
Maximum time in seconds that you allow the connection phase of the request to the other server to take.