I am launching a queuing system that deals with millions of messages per day. Mostly through Amazon SQS, but right now I'm also launching a new Beanstalkd system with over 600,000 messages.
As described on the topic blog , I have shell scripts running in loop processing messages (a loop in a PHP script to run multiple jobs before returning is also useful, at least for small jobs).
These shell scripts start with Supervisord . There is another blog entry about using this . Currently, I run more than 800 working scripts (for several different types of tasks) on nine machines, all are pulled from different queues and put the data back into other queues, writing to the database or files. The increase in the number of workers per machine is associated with an increase in the number of "numprocs" (or already large enough), and then, starting with more requests. You could also say 5 autostarts, and then another block of 50, which are ready to be launched as needed.
I find that each worker takes only about 20 mb of non-shared memory (the rest is common to processes). It depends on the tasks that, of course, the employees perform. Resizing images can be a lot of work. Partly because of this, I have a setting that allows you to frequently restart the PHP script.
source share