Scaling out your load tests using Gatling, Packer, and a cloud provider (in this example we will use DigitalOcean and Amazon EC2.

*This post assumes that you know what Gatling is all about and need to scale your existing scenario to run from several machines / from different networks.

*want to try this out? use this referral link and get free 10$ in digital ocean (you can fire up many machines with 10$ :) )

Why scale out ?
-Problem I’ve encountered with Gatling is the max amount of connection 1 machine can send to a server in order to stress test it.
-In a fast explanation the default setting for a ubuntu machine is around 470~ connections (link)
-with some tweaking on the machine (setting virtual network interfaces and increasing the port range) you can get more (link)
-firing up a new VM on the cloud and running reuqests from it is easy, fast and cheap!

First lets create a image for our “Gatling Node”, we can deploy this image multiple times and the images are set to enable ssh from 1 to another, this image template is a packer json – link to packer json file

Image contains

  1. ubuntu14.04 as base image
  2. all necessary pre-executes to run Gatling scenario
  3. SSH keys to enable SSH from nodes to eachother
  4. Gatling installation

After your new cluster is ready you can use this script to run your scenario on all the nodes link to script

Main steps of the script

  1. Copy simulation to all remote hosts
  2. Running simulations all remote hosts
  3. Running simulation on localhost
  4. Collect all simulation to localhost
  5. Generate report with aggregated data
  6. Open browser with the report

the script is pretty strait forward and well documented on each step :

Gatling report example.

Share Button