-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
429 - to many requests #2248
Comments
http://php.net/manual/en/function.curl-multi-setopt.php#refsect1-function.curl-multi-setopt-parameters $httpClient = new Client([
'handler' => new \GuzzleHttp\Handler\CurlMultiHandler(),
'curl' => [
\CURLMOPT_MAX_HOST_CONNECTIONS => 1,
],
'base_uri' => 'https://api.tempo.io',
'headers' => [
'Accept-Encoding' => 'gzip,deflate',
'User-Agent' => 'amasty-report',
'Authorization' => 'Bearer !!!SECRET-TOKEN!!!', //add your token
],
]); |
see https://curl.haxx.se/libcurl/c/CURLMOPT_MAX_HOST_CONNECTIONS.html if ($name === '_mh') {
$this->_mh = curl_multi_init();
curl_multi_setopt($this->_mh, CURLMOPT_MAX_HOST_CONNECTIONS, 5);
curl_multi_setopt($this->_mh, CURLMOPT_PIPELINING, 1);
return $this->_mh;
} debug:
but no more 429 error. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Guzzle version(s) affected: 6.3.3
Description
It creates a lot of connections per host.
How to reproduce
https://gist.github.com/Gemorroj/97df5b1d3a50534dfa6fc21ae7f41813
debug mode says (As far as I understand, a new connection is created for each request):
As a result, because of the many connections I get 429 error.
For comparison, the code on js works in one connection.
The text was updated successfully, but these errors were encountered: