PHP queue jobs in centOS
I wrote a PHP shell script which include queuing jobs in centOS with 'at' command. The queue jobs may vary in time and contents which means the system need to keep quite a large number of jobs. The application logic will also be a bit difficult to setup with cronjob. Is there a limit in number of queue开发者_StackOverflow中文版 jobs in centOS or is there any alternative way of queuing jobs?
You might consider writing to a "distributed" queue such as dropr or an implementation of AMPQ.
A lot of job processes may slow down the whole server. It could happen if there are many of them which started at the same time (or simply work at the same time). If you have 20 hard working processes and only 4 CPU cores they will struggle for CPU and it should switch between them very often.
I'd suggest using a message queue and a pool of workers. You can start from a filesystem queue (or mysql based). You have to install a php lib only, no any extra services. Later if needed, you can switch to real message queue brokers with less effort.
I would recommend using enqueue library.
精彩评论