I can not understand how to properly organize parsing using a proxy, so that requests with a proxy and without it go parallel and new ones are sent without waiting for a response already sent? Now I do this: I divide the array of links to individual arrays by 15 references using array_chunk and then use curl_multi_exec to send a request for them. If I divide the general array not into 15 but into 20 URL's and add a proxy to half of them, I leave the second one as it is:
curl_setopt($ch, CURLOPT_PROXY, $proxy); That overall speed will decrease, as I understand it, because the responses from the proxy come slower and nothing is sent this time.
The question is how to send requests through a proxy, do not wait for answers and continue to send requests? If there is a library that implements this, then please advise. Thank!
PS - When requesting different resources of the same site, for example -
Can I use one connection? I read that opening a connection is time consuming and it’s better to use one.
curl_multi_execand other multi-threading. Write a script: 1 call - 1 link. And make a queue through some rabbitmq + "master script". I would do just that. - Total Pusher