Search
  • Anuradha Agarwal

Setup Locust on Linux using Docker

Updated: Apr 15

This post details steps to set up locust in stand-alone & distributed mode with the help of docker.


To visit more such posts follow hashtag - #Locust #PerformanceTesting


Locust can be installed independently without docker by making sure we install dependencies first. With docker, we don't need to worry about dependencies. With one single command, we can make locust up both in standalone & distributed mode. With this post, we will be achieving the same.


Make sure you save generated private key at a safe place.

Change the permissions of the key as indicated here

Make sure instance gets into the running state. Note Public DNS from instance status window.

Use puttygen to convert private key file to.ppk format. Steps can be referred here


In case you don't have a Linux machine:

Please follow steps to connect AWS EC2 instance using putty



MILESTONE STEPS TO SETUP LOCUST ON LINUX USING DOCKER

Follow commands:

  • Include the ec2-user on your docker set and execute the command without having to use sudo.

  • Right-click on top of terminal and select duplicate terminal to open a fresh new terminal

  • Type command :


  • You get to see a lot of information. Your docker is installed.

  • Next step is to pull official docker image for locust

  • Verify image is available on aws machine using docker image command:


Copy the script from here on a notepad and save the script as locustfile.py on your local machine. At this point, we will not try to understand the script.

  • Run below command:

  • This command will execute locust in standalone mode & locust UI could be opened at Http://<machineIp>:8089

  • To run locust in distributed mode extra port binding is required for master-slave communication:




54 views1 comment
Never Miss a Post. Subscribe Now!