Command line |
Environment |
Config file |
Description |
|
|
|
The Python file or module that contains your test, e.g. ‘my_test.py’. Accepts multiple comma-separated .py files, a package name/directory or a url to a remote locustfile. Defaults to ‘locustfile.py’. |
|
|
|
Host to load test, in the following format: https://www.example.com |
|
|
|
Peak number of concurrent Locust users. Primarily used together with –headless or –autostart. Can be changed during a test by keyboard inputs w, W (spawn 1, 10 users) and s, S (stop 1, 10 users) |
|
|
|
Rate to spawn users at (users per second). Primarily used together with –headless or –autostart |
|
|
|
Stop after the specified amount of time, e.g. (300s, 20m, 3h, 1h30m, etc.). Only used together with –headless or –autostart. Defaults to run forever. |
|
|
|
User configuration as a JSON string or file. A list of arguments or an Array of JSON configuration may be provided |
|
|
|
Host to bind the web interface to. Defaults to ‘*’ (all interfaces) |
|
|
|
Port on which to run web host |
|
|
|
Disable the web interface, and start the test immediately. Use -u and -t to control user count and run time |
|
|
|
Starts the test immediately (like –headless, but without disabling the web UI) |
|
|
|
Quits Locust entirely, X seconds after the run is finished. Only used together with –autostart. The default is to keep Locust running until you shut it down using CTRL+C |
|
|
|
Protects the web interface with a login page. See https://docs.locust.io/en/stable/extending-locust.html#authentication |
|
|
|
Optional path to TLS certificate to use to serve over HTTPS |
|
|
|
Optional path to TLS private key to use to serve over HTTPS |
|
|
|
Enable select boxes in the web interface to choose from all available User classes and Shape classes |
|
|
|
Launch locust as a master node, to which worker nodes connect. |
|
|
|
IP address for the master to listen on, e.g ‘192.168.1.1’. Defaults to * (all available interfaces). |
|
|
|
Port for the master to listen on. Defaults to 5557. |
|
|
|
Delay starting the test until this number of workers have connected (only used in combination with –headless/–autostart). |
|
|
|
How long should the master wait for workers to connect before giving up. Defaults to wait forever |
|
|
|
Set locust to run in distributed mode with this process as worker. Can be combined with setting –locustfile to ‘-’ to download it from master. |
|
|
|
Number of times to fork the locust process, to enable using system. Combine with –worker flag or let it automatically set –worker and –master flags for an all-in-one-solution. Not available on Windows. Experimental. |
|
|
|
Hostname of locust master node to connect to. Defaults to 127.0.0.1. |
|
|
|
Port to connect to on master node. Defaults to 5557. |
|
|
|
Base path for the web interface (e.g., ‘/locust’). Default is empty (root path). |
|
|
|
List of tags to include in the test, so only tasks with at least one matching tag will be executed |
|
|
|
List of tags to exclude from the test, so only tasks with no matching tags will be executed |
|
|
|
Store request stats to files in CSV format. Setting this option will generate three files: <filename>_stats.csv, <filename>_stats_history.csv and <filename>_failures.csv. Any folders part of the prefix will be automatically created |
|
|
|
Store each stats entry in CSV format to _stats_history.csv file. You must also specify the ‘–csv’ argument to enable this. |
|
|
|
Enable periodic printing of request stats in UI runs |
|
|
|
Disable periodic printing of request stats during –headless run |
|
|
|
Reset statistics once spawning has been completed. Should be set on both master and workers when running in distributed mode |
|
|
|
Store HTML report to file path specified. Able to parse certain tags - {u}, {r}, {t} and convert them to number of users, spawn rate and run time respectively. |
|
|
|
Disable Locust’s logging setup. Instead, the configuration is provided by the Locust test or Python defaults. |
|
|
|
Choose between DEBUG/INFO/WARNING/ERROR/CRITICAL. Default is INFO. |
|
|
|
Path to log file. If not set, log will go to stderr |
|
|
|
Sets the process exit code to use when a test result contain any failure or error. Defaults to 1. |
|
|
|
Number of seconds to wait for a simulated user to complete any executing task before exiting. Default is to terminate immediately. When running distributed, this only needs to be specified on the master. |
|
|
|
Instrument the Locust test run with OpenTelemetry. |