Why is PHP’s CURL so slow? compared to wget/Browse?

Asked

Viewed 418 times

3

I’ve been working with the CURL of PHP 5.6, it is extremely slow with respect to other resources like wget/browse/file_get_contents.
In a REQUEST POST simple, it has delay of 4-10 seconds compared to other resources, I have researched in several places, many say it is DNS, but, I already tried to put IP, connection timeout etc..
I’ve tried everything and nothing fast, and it’s not the side of request, because I test with several famous servers like Facebook or Instagram, portals with extremely powerful latency server, and nothing, always has a delay.

Does anyone have any tested solution that improves the performance of CURL of PHP 5.6 or other more intelligent protocol communication resource HTTP?

  • This is strange, usually Curl is faster (or equal) than the other methods, at least in all the tests I did. One thing that can help is using DNS CACHE and also only using Ipv4 or instead of searching for Ipv6.

  • Post the complete code used to mount the CURL request, sometimes it is some ill defined option.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.