Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.6k
[HttpClient] makeHttpClient::create()
return anAmpHttpClient
whenamphp/http-client
is found but curl is not or too old#35924
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
HttpClient::create()
return anAmpHttpClient
whenamphp/http-client
is found but curl is notHttpClient::create()
return anAmpHttpClient
whenamphp/http-client
is found but curl is not or too oldAweomse, since majority of PaaS outhere have a bad habit of using a really outdated curl version. 🎉 |
nicolas-grekas commentedMar 3, 2020 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@kelunik the test suite of the Messenger component is failing when using
The reproducer is: docker pull feathj/fake-sqsdocker run -d -p 9494:9494 --name sqs feathj/fake-sqsexport MESSENGER_SQS_DSN=sqs://localhost:9494/messages?sslmode=disable./phpunit src/Symfony/Component/Messenger/ -v --filter Sqs At first, I thought the reason was the The test passes when using the curl or the native client. |
nicolas-grekas commentedMar 3, 2020 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
The test passes when I use an |
@nicolas-grekas Do you still have your benchmarking script handy? I was wondering how the Amp client compares to curl, particularly for a single request and many requests to the same host, both HTTP/1.1 and HTTP/2. |
nicolas-grekas commentedMar 3, 2020 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Sure, here it is. <?phprequire__DIR__.'/vendor/autoload.php';$client =newSymfony\Component\HttpClient\AmpHttpClient(['http_version' =>1.1]);for ($i =0;$i <379; ++$i) {$uri ="https://http2.akamai.com/demo/tile-$i.png";$responses[] =$client->request('GET',$uri);}foreach ($client->stream($responses)as$response =>$chunk) {if ($chunk->isLast()) {// a $response completedecho'.'; }else {// a $response's got network activity or timeout }}echo"\n"; |
0eb451f
to87c5be9
Compare…en `amphp/http-client` is found but curl is not or too old
87c5be9
to7991685
Comparenicolas-grekas commentedMar 13, 2020 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Green. Status: needs review |
Thank you@nicolas-grekas. |
@nicolas-grekas Thanks for the script again. I see the same results: About the same for HTTP/2, slower for HTTP/1.x. Will have to investigate what's slowing down HTTP/1.x. I was fishing for a reason to have Amp's client be the default client, but I don't really have a compelling reason for that other than installation consistency and portability. 😝 Is there a way to suggest using Amp if the client falls back to using |
We already have an |
Follows#35115
Let's use
amphp/http-client
by default, aftercurl
and beforefopen()
.