RabbitMQ on Raspberry Pi

Playing around with RabbitMQ lately, I was interested how it would perform on a very small box, a
Raspberry Pi.

Here is a short description how to get RabbitMQ running on a Raspberry Pi.

  1. get a Raspberry Pi installed with Raspbian – just follow the standard installation guide from http://www.raspberrypi.org/downloads/
  2. get the rabbit MQ package from here: http://www.rabbitmq.com/install-debian.html
  3. I wanted to run a client in Node.js, so I got the latest node with these commands:

    wget http://node-arm.herokuapp.com/node_latest_armhf.deb
    sudo dpkg -i node_latest_armhf.deb
    node -v
  4. pick the node version of the RabbitMQ tutorials from here: https://github.com/squaremo/amqp.node/tree/master/examples/tutorials

Here is how this looks in pictures:

Raspberry Pi running RabbitMQ

Raspberry Pi running RabbitMQ

node.js client running with rabbitMQ on a Raspberry Pi

node.js client running with rabbitMQ on a Raspberry Pi

And the results: If you let a publisher with a simple “hello world” message run in a loop for 1000 times and start a subscriber for this queue at the same time, you will see the 1000 messages flying through your little Rabbit Pi in about 13 seconds, more than 50 messages per second!

You will also notice that there is hardly any concurrency between the publisher and subscriber, so the messages only get consumed when the publisher gets idle. This is contrary to what I see on a desktop linux system where the subscriber always “wins” and keeps the queue empty, and the publisher is slowed down to the pace of the subscriber.

You probably do not want to push the little Raspberry to many messages per second, but it is nice to know that you can!

7 thoughts on “RabbitMQ on Raspberry Pi

    • Thanks, Tobias. The fact that RabbitMQ can run on such a low-end hardware is amazing. I originally imagined that it would require huge amount of resources like Elastic servers.

      Your answer clarifies my doubt in using RabbitMQ for embedded environment. Thanks!

  1. I’m looking to utilise a message broker as a small part of a larger project, and 50 messages per second wouldn’t cut it.
    If you’re after speed, but less functionality, try an MQTT broker.

    commonly served on linux distros with `mosquitto`

    sudo apt install mosquitto

    with a python client… `paho-mqtt` (you’ll be able to find example code easily)

    Performance:
    I just ran “hello world” 1000 times through a raspberry pi3 in 0.286904 sec (so that’s 3485 geo-salutations per second)
    (that was direct to localhost, so that’s just the broker’s overhead, + unavoidable network overhead)

    anyway… just for those interrested… enjoy

  2. Pingback: Internet of Things Messaging, Part 3: Testing Mosquitto - Padtronics

  3. If you don’t mind me asking, what’s the specific hardware spec on that Raspberry Pi? CPU, RAM, storage type and capacity.

  4. This was a few years ago on the first generation Raspberry Pi 1 Model B with 700 MHz ARM 6 CPU, 512 MB RAM. SD card was probably 4 GB at that time. Anything you buy today will probably be faster.

Leave a comment