php speeding up massive gcm push sending
<p>I have made up a push notification sender in php and I need to speed it up. Currently I have 20 000 subscribers and it takes me about 20 min. to send the same message to all of them and I think it is too long. My sender works as follows:</p>

<p>1) Pick up all subscriber IDs from MySQL DB and put them into array. </p>

<p>2) Foreach all subscriber IDs picked up in step 1 and curl the http request to google server to send a push message - 1 per subscriber ID.</p>

<p>3) Get a response from google server and perform a MySQL query in order to delete a subscriber ID from a DB in case of error - 1 per each subscriber ID. </p>

<p>Currently my script works in a single thread (one foreach loop) and processes subscriber IDs one-by-one. I would like to know if there is a way to make several independent foreach loops in order to process registration IDs in parallel? Or maybe I could make it in several independent PHP processes? Maybe PHP is not the best solution for that and there are some examples of this in other languages? In any case I don`t want to wait for a single foreach loop while it processes all my 20 000 subscribers as it is now. Also I know about bulk sending in 1000 subscriber IDs, but in this case I cannot receive back from google a status of message my message per every subscriber ID. Any ideas would be welcome. Thank you.</p>