Configuration
Configure URLs, VUs, durations and environment files.
On this page
Choose the right working directory. Examples using
npm runshortcuts,node bin/loadstride.js, or top-levelstarter-kit/paths run from the LoadStride source checkout. Those shortcuts do not exist in your application’s package.json. Installed-package users runnpx --no-install loadstridefrom their application directory. See Getting started for both options.
Configuration
The CLI automatically reads .env from your current working directory before
importing the test script. Precedence is CLI flags > shell environment > .env >
script options. Existing shell variables are preserved when loading the file.
The programmatic run() API takes explicit options and does not load .env.
TARGET_URL=https://your-app.example/api/health
LOADSTRIDE_EXECUTOR=constant-arrival-rate
LOADSTRIDE_RATE=50
LOADSTRIDE_MAX_VUS=20
LOADSTRIDE_DURATION=10s
LOADSTRIDE_TIMEOUT=10s
LOADSTRIDE_GRACEFUL_STOP=5s
For 10 concurrent virtual users over 30 seconds, replace the workload settings
with these (remove or comment out LOADSTRIDE_RATE, LOADSTRIDE_MAX_VUS, and LOADSTRIDE_ITERATIONS):
TARGET_URL=https://your-app.example/api/health
LOADSTRIDE_EXECUTOR=constant-vus
LOADSTRIDE_VUS=10
LOADSTRIDE_DURATION=30s
For 100 total iterations across 10 virtual users, replace the workload settings
with these (remove or comment out LOADSTRIDE_DURATION, LOADSTRIDE_RATE, and LOADSTRIDE_MAX_VUS):
TARGET_URL=https://your-app.example/api/health
LOADSTRIDE_EXECUTOR=constant-vus
LOADSTRIDE_VUS=10
LOADSTRIDE_ITERATIONS=100
VUs means concurrent users, not users per second. LOADSTRIDE_RATE is iteration starts
per second. LOADSTRIDE_MAX_VUS caps active iterations in arrival mode; LOADSTRIDE_VUS sets the
fixed-user count. These modes are alternatives; avoid mixing their settings.
| Environment variable | CLI flag | Meaning |
|---|---|---|
TARGET_URL |
--url |
Target URL used by the included example scripts |
LOADSTRIDE_EXECUTOR |
--executor |
Fixed or ramping user/arrival executor |
LOADSTRIDE_ENGINE |
--engine |
http (default) or optional browser |
LOADSTRIDE_STAGES |
--stages |
JSON array of duration/target stages |
LOADSTRIDE_START_VUS |
--start-vus |
Initial ramping user count (default 0) |
LOADSTRIDE_START_RATE |
--start-rate |
Initial ramping arrival rate (default 0) |
LOADSTRIDE_VUS |
--vus |
Fixed concurrent users; fallback cap in arrival mode |
LOADSTRIDE_RATE |
--rate |
Arrival-mode iteration starts per second |
LOADSTRIDE_MAX_VUS |
--max-vus |
Arrival-mode concurrency cap |
LOADSTRIDE_SCHEDULING |
--scheduling |
Arrival policy: timer (default) or experimental precision |
LOADSTRIDE_DURATION |
--duration |
Scheduling duration, such as 30s |
LOADSTRIDE_ITERATIONS |
--iterations |
Total iterations in fixed-user mode |
LOADSTRIDE_TIMEOUT |
--timeout |
HTTP request timeout |
LOADSTRIDE_GRACEFUL_STOP |
--graceful-stop |
Allowed drain period after the duration |
Select another file with --env-file staging.env. Missing .env is allowed;
a missing explicit file is an error. Use --no-env to skip file loading (shell
variables still apply). A blank LOADSTRIDE_ value is ignored. The file format supports
single-line values, comments, optional export, and single or double quotes;
shell commands and variable interpolation are not executed. .env is git-ignored;
.env.example is included as the shareable template.
When invoking the source directly with an explicit env file, put -- before the
script path so Node’s own --env-file parser leaves the option to LoadStride:
node -- bin/loadstride.js run starter-kit/basic.js --env-file staging.env
The npm shortcuts and installed executable include this argument boundary automatically.
URLs remain part of script logic: custom scripts must use process.env.TARGET_URL
if they should honor .env or --url. Thresholds, request bodies, authentication,
and multi-request workflows remain in the JavaScript test file.
Based on the released v0.2.0 guide. View source on GitHub.