Skip to main content
The PreScale GitHub Action load-tests each pull request, uploads the result, and keeps one comment on the pull request up to date:

🔴 Capacity regressed: 100 → 50 users (−50%)

Breaks first: /api/search?q=shoe · p95 crossed the latency wall at ~75 users Why: concurrency_ceiling (high confidence) · Fix: raise the worker count, or scale out.
The bars are PreScale’s mark in text: sparse ░ → ▒ → a solid █ end at the capacity measured. When more than one route is tested, the comment also shows each route’s p95 as a bar toward the latency wall (┆). There are two ways to run it:
  • Replica mode (recommended): the Action builds the pull request in the job and tests it on localhost. No deploy, no host, nothing to arrange.
  • A deployed staging URL: the Action tests a deploy once it finishes. Only for staging you’re allowed to load-test.
The Action starts your app in the job with your build-and-start command, waits for it to answer, tests it, and stops it. No host is involved, so no host’s load-testing rules apply and no CDN shapes the result. See Replica mode for how it works.
1

Add a token as a secret

Create a token on the dashboard’s Connect page and save it as the PRESCALE_TOKEN repository secret.
2

Add your target

Add a target for the app in the dashboard (for example myapp.com). Runs from every pull request attach to it, and its timeline shows how capacity changes over time.
3

Commit the workflow

.github/workflows/capacity.yml
Pushes to main record the baseline; each pull request is compared with it. The app’s command is never saved or uploaded, and results say they were measured on a build of the commit in CI, so serverless behaviour such as cold starts isn’t included.
Not a Node app? Any command that starts a production server works, such as gunicorn app:app -b 127.0.0.1:3000 or bin/rails server -e production -p 3000. Set url if it listens somewhere other than http://localhost:3000, and working-directory if the app lives in a subfolder.

Testing a deployed staging URL

Your host’s rules come first. Vercel only permits load testing on Enterprise plans, with prior notice. Netlify needs its express permission, and Cloudflare blocks load tests unless they’re arranged. See Hosts that restrict load testing.
On deploys hosted by Vercel, Netlify or Cloudflare, the Action skips the test, says why on the pull request and in the job summary, and passes. Set host-permission: true only if you have that host’s permission. Use this mode for staging you’re allowed to load: your own servers, or a host that permits load testing.
.github/workflows/capacity.yml
To give these pull requests a baseline, also run the check on pushes to main against your staging URL (set url and comment: false). Until there is one, each push compares with the previous push on the same pull request.

Safety and cost

In replica mode the app uses the job’s environment; on a deploy it uses the deploy’s. Either way the load reaches whatever database the app talks to. Point it at dev or staging, never production.
  • Production deploys are skipped unless you set allow-production: true.
  • Restricted hosts are skipped unless you set host-permission: true.
  • Gentle by default: 100 virtual users per check. On a serverless deploy every request is a billed invocation; the job log says how many requests each check sent.
  • Headers and the app command stay private: headers go to your site only, and neither is saved or uploaded.
  • fail-on-regression fails the check only on a confirmed drop (more than 20%, with confidence bands that don’t overlap). Uncertain drops show as a warning.

Inputs

Not on GitHub? prescale ci --target myapp.com --app "npm run build && npm start" does the same from any CI.