We have already described MQTT installation in the previous post, also need to test the scalability and load behaviour of MQTT environments.


Before that, necessary to install requires packages mosquitto python library 1.x or greater and supporting packages,

Install and Update:

$ sudo apt-get update

$ sudo apt-get install gcc

$ sudo apt-ge install libtool

$ sudo apt-get install python-pip

$ sudo apt-get install git

$ sudo apt-get -y install  python-mosquitto

$ sudo apt-get install unzip 

Check your PIP and  Python version,

$ sudo pip --version

pip 1.5.4 from /usr/lib/python2.7/dist-packages (python 2.7)
root@ip-172-30-1-121:~# python -V
Python 2.7.6

Download MQTT-python for  install

$ sudo git clone git://git.eclipse.org/gitroot/paho/org.eclipse.paho.mqtt.python.git

$ cd org.eclipse.paho.mqtt.python/

$  python setup.py install

$  pip install fusepy

Now, download the mqtt-malaria package and test.

$ sudo wget https://github.com/remakeelectric/mqtt-malaria/archive/master.zip

$ sudo unzip master.zip

$ sudo cd mqtt-malaria-master

Edit configure file, set an IP address which is installed MQTT server for testing scalability and performance 

$ sudo  vim Vagrantfile

Vagrant.configure("2") do |config|
  servers = {
    :bee1 => ""
    :bee2 => ""

Execute the below command to test load performance,

 ./malaria publish -P 100 -n 1000 -H  -s 100  -T 1 -q 0 

If you may get an error like,

ImportError: No module named mosquitto or require any other package just run the below command,

$ sudo chmod +x vagrant.bootstrap.sh

$ sudo ./vagrant.bootstrap.sh

Example output:

Clientid: Aggregate stats (simple avg) for 100 processes
Message success rate: 100.00% (1000/1000 messages)
Message timing mean   517.41 ms
Message timing stddev 0.00 ms
Message timing min    517.41 ms
Message timing max    517.41 ms
Messages per second   49.24
Total time            14.05 secs

For more information about Malaria