Last Updated: February 25, 2016
·
814
· Blitline Support

Put beanstalkd into Drain Mode

There is not a ton of documentation on beanstalkd, but it is a great tool.

One of the things that is pretty common is that you need to reboot a machine, but you don't want to lose the items in your beanstalkd queue.

You can put it into 'drain' mode, which only allows items to be taken OUT of the queue, and not put into it. This allows the queue to drain to zero, and then you can reboot your machine without losing data.

To put beanstalkd into drain mode you need to issue a SIGUSER1 to the process, which you can do with the following:

kill -10 <beanstalkd process id>

(10 is the SIGUSER1 signal).