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
Post a Comment