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 !

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

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay