Home  >  Q&A  >  body text

php - The queue is relatively large, how to handle it with multiple threads

The length of a queue is 10,000, and it takes about 2 seconds to execute a process. 10,000 items means 20,000 seconds.
If you use contab to execute it every two seconds, it will take almost 6 hours to complete. Is there any way to solve it?

怪我咯怪我咯2663 days ago924

reply all(1)I'll reply

  • PHP中文网

    PHP中文网2017-07-04 13:48:21

    Why use crontab?

    You can make the consumer queue program into a daemon. If one is not processed in time, several more will be created.

    reply
    0
  • Cancelreply