php - Reusing the same curl handle. Big performance increase? -


in php script doing lot of different curl requests (a hundred) different url.

is reusing same curl handle curl_init improve performance or negligible compare response time of curl requests?

i asking because in current architecture not easy keep same curl handle.

thanks,

benjamin

it depends on if urls on same servers or not. if are, concurrent requests same server reuse connection. see curlopt_forbid_reuse.

if urls on same server need sort urls default connection cache limited ten or twenty connections.

if on different servers there no speed advantage on using same handle.

with curl_multi_exec can connect different servers @ same time (parallel). need queuing not use thousands of simultaneous connections.


Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -