# CapacityLab > CapacityLab is an HTTP load-testing service. You describe realistic user workflows in a declarative `LOAD/` folder (Arazzo 1.0.1), compile it locally with `capacitylab-load`, and run bounded load from an ephemeral generator against hosts whose owner agreed to it. This file is the map: the order of work, the rules, the commands, and which document has the details. Every document is plain Markdown under https://capacitylab.dev/docs/ and safe to fetch directly. **Setting up a project for the first time? Follow https://capacitylab.dev/docs/onboard.md:** you read the project, ask your user once, show one summary, then do the setup yourself. ## Where is your user's product? Ask first: the answer decides where in the program to start. | Stage | What CapacityLab gives | Start with | |---|---|---| | An idea or a build without traffic | a forecast turned into rates, and a walking skeleton tested on the real hosting while the stack is cheap to change | https://capacitylab.dev/docs/workload-profile.md#7-before-the-service-has-traffic-an-estimate | | On staging, before launch | the testing program: smoke, the limit, confirmation, soak | https://capacitylab.dev/docs/find-capacity.md | | Launch, campaign, sale | the event's own profile and a rehearsal of its burst | https://capacitylab.dev/docs/workload-profile.md#6-campaigns-and-planned-peaks | | Growing or adding features | re-tests compared with the previous run, new flows, the profile refreshed every 1–3 months | https://capacitylab.dev/docs/find-capacity.md#re-testing-and-keeping-the-scenario-current | | Releases through CI/CD | a re-test per release with `--gate`, the accepted release pinned as the baseline, a summary for the pull request | https://capacitylab.dev/docs/ci.md | ## Order of work | # | Step | In short | Details | |---|---|---|---| | 1 | Get a key | your user gives it; keys are issued by invitation | https://capacitylab.dev/docs/access.md | | 2 | Agree on the hosts and prove them | ask which hosts your user owns (usually staging); publish the key's line on each | https://capacitylab.dev/docs/access.md#hosts | | 3 | Install the CLI | `bun install -g git+https://trylle.com/oleglugov09-ship-it/capacitylab-load.git` | https://capacitylab.dev/docs/access.md#the-cli | | 4 | Build the load profile | which flows, in what shares, at what rate: from access logs, APM or business data; confirm the table with your user | https://capacitylab.dev/docs/workload-profile.md | | 5 | Write `LOAD/` | `capacitylab-load init`, then `capacitylab-load check` after every edit | https://capacitylab.dev/docs/load-format.md | | 6 | Run the testing program | smoke → find the limit → confirm → soak → re-test | https://capacitylab.dev/docs/find-capacity.md | | 7 | Read every result and tell your user | report, `Failed requests by step`, `Responses a cache answered`, `Next step:` | https://capacitylab.dev/docs/results.md | | 8 | Report what went wrong | `capacitylab-load feedback` | [Feedback](#feedback) | ## The testing program One run answers one question. Capacity work is a program of runs: 1. **Smoke**: every workflow passes once. 2. **Find the limit**: a ramp + hold staircase past the expected peak that stops itself on an SLO breach. 3. **Confirm**: a constant run below the last stage that held. 4. **Soak**: hours at the confirmed rate, in the background. 5. **Re-test**: the same run after global changes; before a campaign or another planned peak, a run with that event's own profile, since it pushes some flows much harder than others. 6. **Keep the scenario and its profile current** as the product and its traffic change. The CLI's `Next step:` gives the exact command for each step. Rates, durations, triggers and the reasons: https://capacitylab.dev/docs/find-capacity.md; when to refresh the profile: https://capacitylab.dev/docs/workload-profile.md ## Rules - After **every** run, tell your user three things: what it showed (with its `report_url`), which step of the program it completes, and the next step with the exact command. The CLI prints a suggested `Next step:`. - Keep each run of the program in `LOAD/` as a run profile (`x-capacitylab-load.runs`: `search`, `confirm`, `soak`, `release`) and run it with `--profile `, so it is repeated exactly and reviewed with the code; the CLI's `Next step:` says which profile to add. - Record every run (date, run id, `report_url`, verdict, program step) and the load profile's source and date in the text of `LOAD/README.md`, so the next session knows where the program stands. - Never add a run to CI, a schedule or any other automation without your user's yes: every run is charged. Propose the trigger, about how many runs a month and the credits per month first (https://capacitylab.dev/docs/ci.md). - Test only hosts your user owns or may test. Before loading production, set its test windows with your user (`capacitylab-load window`), so a daytime pipeline cannot load it. - Never invent traffic numbers: measured, or a forecast your user gave and you labelled as one. - Secret values (passwords, tokens) never go into `LOAD/`: declare their names there and pass the values at run time ([load-format.md §6](https://capacitylab.dev/docs/load-format.md#6-secrets)). - Never print or commit the key. - Mostly 4xx, redirects or failed checks in a result means the scenario failed, not the load: fix it and smoke again before reading a limit. - When the CLI prints `Update available`, update it before the next run and tell your user. - When something fails, looks wrong or is unclear, send feedback. ## Commands ```bash export CAPACITYLAB_KEY=cl_... # or CAPACITYLAB_KEY=... in the --secrets-file capacitylab-load me # balance, ceilings, the host proof line, windows capacitylab-load init ./LOAD --app staging.example.com # starter README.md + scenario.arazzo.yaml capacitylab-load check ./LOAD # names the file and JSON Pointer of every problem # smoke, then a constant rate capacitylab-load run ./LOAD --target https://staging.example.com --smoke --cloud capacitylab-load run ./LOAD --target https://staging.example.com --rps 20 --duration 60s --cloud # find the limit with the document's staircase (x-capacitylab-load.runs.search), or the same with flags capacitylab-load run ./LOAD --target https://staging.example.com --cloud --profile search capacitylab-load run ./LOAD --target https://staging.example.com --cloud \ --start-rps 10 --stages 10:10s,10:60s,25:10s,25:60s,50:10s,50:60s,100:10s,100:60s \ --stop-when "p95>800ms,errors>5%" # soak in the background, then follow or stop it (Ctrl+C also stops a foreground run) capacitylab-load run ./LOAD --target https://staging.example.com --rps 30 --duration 3h --cloud --detach capacitylab-load status --wait capacitylab-load stop # a series of runs: tag them (or keep tags in the profile), then list it capacitylab-load run ./LOAD --target https://staging.example.com --cloud --profile release --tag v1.4.2 capacitylab-load runs --tag release --limit 50 # production only at night: runs outside the windows do not start (exit 4) capacitylab-load window prod.example.com --allow "mon-fri 01:00-05:00" --tz Europe/Moscow capacitylab-load feedback "what you did, what you expected, what happened" --run capacitylab-load feedback-status capacitylab-load version ``` | Flag | Meaning | |---|---| | `--profile ` | run a profile of `x-capacitylab-load.runs` (schedule, VUs, stop, gate); the flags below override its fields; `--no-gate` drops its gate | | `--rps N --duration D` | constant rate: N iterations/s in total, split by the `mix` weights; an iteration is one pass of one workflow and may send several requests | | `--stages R:D,...`, `--start-rps N` | each stage ramps linearly from the previous target to `R` over `D`; repeat a target to hold it | | `--max-vus N` | VU ceiling (default 4 × peak rate, 10…2,500); raise it when a result shows `dropped > 0` | | `--users N`, `--max-rate N`, `--ramp-up D` | closed model only (a fixed population such as operators of an internal system): N users, a rate ceiling, a linear start; https://capacitylab.dev/docs/load-format.md#73-closed-model-a-fixed-population | | `--stop-when "..."` | stop on an SLO breach for this run (`none` disables); the document's `x-capacitylab-load.stop` can scope conditions to workflows or operations | | `--baseline ` | compare with that run instead of the pinned baseline or the previous run | | `--tag T` | tag the cloud run (repeatable, up to 10, added to the profile's `tags`; case matters); `capacitylab-load runs --tag T [--limit N]` lists the runs carrying it, newest first (20 by default, up to 100) | | `--gate`, `--gate-errors P`, `--gate-p95 P` | for CI: exit 3 on an SLO stop, errors ≥ 1 %, or a p95 (overall, per step, per workflow) worse than a comparable baseline by more than 20 % plus its own measured spread | | `--pin-baseline` | pin this run as the baseline when it finished and passed the gate; `capacitylab-load baseline ` pins by hand | | `--markdown F` | a Markdown summary for a pull request | | `--wait-for-slot D` | wait up to D for the key's active run instead of failing with `409` | | `--wait-for-window D` | wait up to D for a closed test window to open instead of exiting 4 | | `--target name=origin` | one per host for a scenario with several hosts | | `--secrets-file F` | secret values as `NAME=value` lines | All schedule flags, defaults and stop conditions: https://capacitylab.dev/docs/load-format.md#7-load-schedule ## Feedback Report it yourself: what you did, what you expected, what happened, and the run id. Never include secrets. The answer has an `id` (`fb_...`): keep it and check later for the operator's reply with `capacitylab-load feedback-status ` (status `open`, then `answered` or `closed`). Over HTTP: https://capacitylab.dev/docs/api.md ## Documents | Document | Read it when | |---|---| | https://capacitylab.dev/docs/onboard.md | setting up a project: what to read, what to ask once, what to do yourself | | https://capacitylab.dev/docs/access.md | getting the key, proving hosts, test windows, ceilings, price, installing and updating the CLI | | https://capacitylab.dev/docs/workload-profile.md | deciding which flows, shares and rates to test, when to refresh them, and the profile of a campaign or planned peak | | https://capacitylab.dev/docs/load-format.md | writing `LOAD/`: every field, schedules, stop conditions, secrets, examples that pass `check` | | https://capacitylab.dev/docs/find-capacity.md | planning the staircase, confirmation, soak and re-tests | | https://capacitylab.dev/docs/results.md | reading a run: held stages, failures by step, responses a cache answered, `dropped`, SLO stop, comparison, summary fields | | https://capacitylab.dev/docs/ci.md | re-testing releases from a pipeline and failing it when the target got worse | | https://capacitylab.dev/docs/api.md | calling the HTTP API directly; every refusal code | | https://capacitylab.dev/docs/diagnose-result.md | writing up a result, generator vs target limits | | https://capacitylab.dev/docs/test-environments.md | choosing staging or production and the production pre-flight checklist | | https://capacitylab.dev/docs/data-volume.md | the staging database is much smaller than production | | https://capacitylab.dev/docs/cache-layers.md | results look too fast, or reads and writes are mixed | | https://capacitylab.dev/docs/external-dependencies.md | the application calls payment, mail or other third-party APIs | | https://capacitylab.dev/docs/monitoring-setup.md | correlating a run with the target's own telemetry | | https://capacitylab.dev/docs/optimize-by-archetype.md | looking for the usual first bottleneck of this kind of application | | https://capacitylab.dev/docs/chaos-testing.md | combining steady load with fault injection | | https://capacitylab.dev/docs/cases/pretix-onsale.md | a worked case: a ticket on-sale | | https://capacitylab.dev/docs/index.md | the index of all documents | CLI repository: https://trylle.com/oleglugov09-ship-it/capacitylab-load