Setting Up & Running Locust.io

Installing

This tutorial works on the assumption you are using ubuntu 14.04

Run the following command:

sudo apt-get update && sudo apt-get -y install python-pip python-dev libxml2-dev libxslt-dev
sudo pip install locustio && sudo pip install pyzmq
ulimit -n 9999
  1. This will update the current system
  2. Install python pip (is required by locust)
  3. Install python!
  4. Install locust
  5. Install pyzmq - This is mainly used when spreading tests across multiple servers to increase the testing capacity.
  6. Set file limit to unlimited (this is to ensure we don't have any OS problems with files at concurrency)

 

Running a test

A test can be run on one server, but as soon as you reach the hardware limitations, you will need to scale horizontally.

To exec a test just one server:

  1. Upload the locust test file (Click here to see how to make a locust testfile)
  2. Exec this command (this only starts the interface to control the tests it doesnt actually start a test):
    locust -f ./test.py --host=http://somedomain.io --master
  3. You will get this:
    SHOW LOCUST PICS HERE
  4. Go to the web interface to control the test variables and to start and stop it.

 

Running on multiple hosts

You will have a master slave setup where only one master exists. 

Run the "running a test" steps on each node you want to have as part of the testing cluster but on each slave you should exec this instead:

locust -f ./test.py --host=http://somedomain.io --slave --master-host=x.x.x.x

Where x.x.x.x is the ip of the master you would have set up in the  "running a test" section.

You will only need to use the one admin interface provided my the master. It should report whether the slaves are correctly setup and activey serving traffic.

Details
Updated: 24th March 2016

Play Blokr Now FREE!
blokr.io the web game where you can eat other blocks!