Locust Test

What is Locust?

Locust is an open-source load testing and performance testing framework designed to measure how systems behave under load using scenarios primarily written in Python. It allows you to simulate user behavior to evaluate the scalability of web applications, APIs, and other systems.

For more information, you can visit Locust’s website and GitHub repository.

How does Locust work in Loadium?

You can upload your Locust test files as a ZIP through the Loadium interface. Running on Loadium will enable your Locust tests to run tests across multiple regions and handle high load levels.

Loadium uses Locust version 2.29.1. If you require a different version, you can forward your request to Loadium's support.

Loadium's current Python version is 3.12.x.

Creating a test in Loadium

To create a test,

  • Go to Loadium New Test page

  • Choose "Locust" test type

  • Upload your Locust project files as a ZIP

  • Enter your configurations (test name, virtual user amount, load regions etc.)

The locustfile.py file in the uploaded ZIP will be launched on the server. Therefore, the "main" file (where the test execution steps are placed) of your test must be named "locustfile.py".

If your test depends on other files (such as reading data from CSV files), you should import them using the path format:

/locust/tests-files/{file path}

Example: Use import(/locust/tests-files/abc.csv) instead of import(abc.csv)

Running the test

To start the test, click the play button on the relevant screen. After a final review on the summarization window, you can initiate the execution.

After approximately 30 seconds, load generators will be ready and you’ll be taken to the report screen and the test will start.

In the report screen, you can click the red “X” button at the top at any time to stop the test. If you do not stop the test manually, it will run for the duration you specified and then stop automatically.

On the report screen, the data coming from your selected regions is displayed in 1-second intervals and visualized in charts. If you wish, you can export these reports. Your reports are stored and protected by Loadium according to your subscription plan.

Last updated