Deploy Locust Private Staging
Private Locust dashboard, worker, and bundled staging smoke test.
master
Just deployed
sample
Just deployed
workers
Just deployed
Deploy and Host Locust Private Staging on Railway
About Hosting Locust Private Staging
The template deploys a Locust dashboard, a worker, and an HTTP fixture, all sourced from the public locustio/locust:2.47.0 image. It generates a unique dashboard password and keeps the three services on the Railway private network. The bundled exercise uses five simulated users and stops after 30 seconds.
Why Deploy Locust on Railway
Use a repeatable distributed test to check the behavior of your own staging service. Locust shows request counts, latency, and failures in the dashboard.
Common Use Cases
- Check for latency changes in a staging health endpoint after an upgrade.
- Verify that a worker can run the same test scenario as the rest of your team.
Dependencies for Locust Private Staging
Deployment Dependencies
Run the bundled test
Choose a new Railway project when deploying the template so the three services get the expected names.
Use Railway SSH port forwarding to reach port 8080 of the master service. Sign in as admin with LOCUST_TEMPLATE_PASSWORD from the master service's variables. Wait for the worker to appear and start the exercise. Open Statistics or Download Data to see the results.
The sample sends requests to http://sample.railway.internal:8080/healthz. Set LOCUST_TEMPLATE_TARGET on the master and worker services to exercise the same route on another private staging service you operate. Scale the workers service if you want to distribute the same scenario across more replicas. Locust distributed mode
Build from source
The template embeds these launch files in its Railway start commands. Run python3 image-start-command.py master to regenerate the command for the master. The worker and sample arguments generate the other two commands. You can also deploy the Dockerfile in this directory with these settings.
| Service | Configuration |
|---|---|
master | LOCUST_TEMPLATE_ROLE=master, PORT=8080, generated LOCUST_TEMPLATE_PASSWORD, and LOCUST_TEMPLATE_TARGET=http://${{sample.RAILWAY_PRIVATE_DOMAIN}}:8080. Health check /healthz. |
workers | LOCUST_TEMPLATE_ROLE=worker, LOCUST_MASTER_NODE_HOST=${{master.RAILWAY_PRIVATE_DOMAIN}}, and the same LOCUST_TEMPLATE_TARGET reference as the master. |
sample | LOCUST_TEMPLATE_ROLE=sample, PORT=8080, health check /healthz. |
Template Content
