Gabriel Bianconi Gabriel Bianconi - 1 year ago 34
PHP Question

Fastest way to ping thousands of websites using PHP

I'm currently pinging URLs using CURL + PHP. But in my script, a request is sent, then it waits until the response comes, then another request, ... If each response takes ~3s to come, in order to ping 10k links it takes more than 8 hours!

Is there a way to send multiple requests at once, like some kind of multi-threading?

Thank you.


You can either fork your php process using pcntl_fork or look into curl's built-in multi-threading.