VOOZH about

URL: https://www.geeksforgeeks.org/python/load-testing-using-locust/

⇱ Load testing using LOCUST - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Load testing using LOCUST

Last Updated : 28 Apr, 2025

Locust is an open-source load-testing tool. Load testing is a type of software testing that is conducted to check the tolerance/behavior of the system under a specific expected load. The target of locust is load-testing websites and checking the number of concurrent users a system can handle. During a locust test, a swarm of locusts will attack the target i.e website. The behavior of each locust is configurable and the swarming process is monitored from a web UI in real time. 

Specialty of locust:

  • Test scenarios can be written in Python
  • Distributed and scalable
  • Web-based UI
  • Any system can be tested using this tool

Installation: Locust can be installed with pip.

pip install locust

Once the locust is successfully installed, a locust command should be available in your shell. To see more available options:

locust --help

Getting started: 

Start locust: To run the above code, create a Python file named locustfile.py, and open the terminal in the directory of the above created file. Then write the following command in the terminal.

locust

Note: By default locust searches for locustfile.py. After the successful execution of the above command, you should open a browser and hit http://127.0.0.1:8089 The Locust UI will appear like below: 👁 Image

Comment