Last Updated: February 25, 2016
·
3.71K
· Blitline Support

Ubuntu 12.04 Beanstalkd Install

Beanstalkd is a blazingly fast work queue, with built in prioritization, persisence, timeouts, and a simple YAML interface. Unfortunately, documentation for it is "sparse". Most of it seems to have an "if you don't know what you are doing you shouldn't be using Beanstalkd" approach, which is too bad because it is one of the primo work queues out there.

See http://adam.heroku.com/past/2010/4/24/beanstalk_a_simple_and_fast_queueing_backend/ for a nice writeup.

So here is some clear, specific instructions on how to get beanstalkd up and running as a startup service on your ubuntu 12 installation.

Ubuntu 12.04 Installation

wget https://github.com/downloads/kr/beanstalkd/beanstalkd-1.8.tar.gz
tar -xvf beanstalkd-1.8.tar.gz
cd beanstalkd-1.8
make
sudo make install

Create startup script

sudo nano /etc/init/beanstalkd.conf

Enter the following into the file beanstalkd.conf that has just opened

description "simple, fast work queue"

start on filesystem
stop on runlevel [!2345]

respawn
respawn limit 5 2

exec su nobody -c 'exec /usr/local/bin/beanstalkd'

This will make it so beanstalkd will start-up on startup of the machine.

Now, lets check to see if it worked!

Reboot your machine. You should be able to:

ps -C beanstalkd

And you should see something like:

PID TTY          TIME CMD                                                     
648 ?        00:00:00 beanstalkd

BAM! Your server is now a beanstalkd server.