DEV Community

Cover image for simple Load testing using Locust
Antoine
Antoine

Posted on

2 2

simple Load testing using Locust

Photo by James Wainscoat on Unsplash

Locust is a system using python to define load testing.
It relies on a main node (hosting UI) to report data. Workers nodes executes workloads.

Loads are defined through objects: Users, tasks

A quick way to test, is to use the following docker-compose:

version: '3'

services:
  master:
    image: locustio/locust
    ports:
     - "8089:8089"
    volumes:
      - ./:/mnt/locust
    command: -f /mnt/locust/locustfile.py --master -H http://master:8089

  worker:
    image: locustio/locust
    volumes:
      - ./:/mnt/locust
    command: -f /mnt/locust/locustfile.py --worker --master-host master
Enter fullscreen mode Exit fullscreen mode

The web UI is then accessible on port 8089 .

UI

Configuration

Locust as written in its docs that Locust uses:

  • User : to define profile
  • Task : to define workload, associated to a weight
  • Events : to define extension points

This repository has a simple example on how to defaine configuration.

Hope this helps !

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more