Browser capacity & sizing
Measure browser VU headroom and interpret conditional CPU/RAM estimates.
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.
Browser capacity calibration
Available in LoadStride 0.2.0. Version 0.1.0 retains its fixed 20-browser-VU ceiling.
Choose browser concurrency explicitly
20 is the default browser guardrail, not an inherent browser-engine capacity. Each browser VU has an isolated context/page. Contexts share 1–4 managed browser instances; each instance may spawn several OS processes. HTTP VUs send requests without rendering pages and have very different resource costs.
node bin/loadstride.js run load-tests/browser-flow.js --no-env \
--vus 50 --browser-max-vus 50 --browser-processes 2 --duration 30s \
--report-dir reports/browser
Equivalent script options are browser: { maxVUs: 50, processes: 2 }.
Environment alternatives are LOADSTRIDE_BROWSER_MAX_VUS=50 and
LOADSTRIDE_BROWSER_PROCESSES=2; CLI overrides take precedence. The normal
--vus option selects actual concurrency; the ceiling only permits it.
The validation ceiling is 100,000, which is not a tested capacity claim.
Fixed VUs and one workload remain the only browser execution mode.
Measure a representative flow
Install optional Playwright/Chromium as described in the README. On macOS/Linux, start a target you control, then run:
npm run browser:calibrate -- load-tests/browser-flow.js --no-env \
--url http://your-test-host:3001 --vu-steps 1,5,10,20,30 \
--duration 10s --warmup 2s --repeats 2 --browser-processes 2 \
--report-dir reports/calibration
The equivalent CLI is node bin/loadstride.js calibrate .... Use a real URL
for your test environment. --url sets TARGET_URL; your script must use it.
For the bundled login/cart flow, start npm run demo:auth-server, then substitute
starter-kit/browser-login.js and --url http://127.0.0.1:3001.
Installed-package users run from their application’s directory:
npx --no-install loadstride calibrate load-tests/browser-flow.mjs --no-env \
--vu-steps 1,5,10,20,30 --duration 10s --warmup 2s --repeats 2 \
--browser-processes 2 --report-dir reports/calibration
Replace node bin/loadstride.js with npx --no-install loadstride for the
other CLI examples in this guide. npm browser:* shortcuts belong to the source
checkout, not your application’s package.json.
The command creates a new worker and browser pool for every trial. Each VU level
is repeated before moving higher. The largest candidate becomes the calibration
ceiling unless an explicit ceiling is supplied; an explicit ceiling must cover
every candidate. Script/environment iteration limits are replaced by the trial
duration. Warmup and measurement are separate runs with separate browser pools;
hooks execute again, so use repeatable test data. Each phase may finish in-flight
iterations within the configured graceful-stop period. Warmup can be disabled
with --warmup 0.
Bounds: 1–12 increasing levels, 1–5 repeats, measurement up to 60s and warmup up to 30s per trial. It stops at the first workload/resource failure. Ctrl+C stops scheduling, closes browsers and saves available evidence. Stalled cleanup has a bounded worker/descendant termination fallback.
Read the results
Each new directory contains:
calibration.html: measured levels, failed gates, repetition links and model status.calibration.json: hardware, script entry-file SHA256, criteria, sampled resources and summary.runs/vus-N-repeat-R/report.htmlandreport.json: ordinary workload results.
The report server discovers the ordinary per-run reports. Open the calibration summary directly; it is not currently a separate item in the report catalog. CLI exit codes: 0 if at least one complete level passed with headroom, 1 if none passed, 130 for interruption, and 2 for command/preflight errors. A later failed level is an expected calibration outcome; examine the summary even after exit 0.
A passing trial requires workload success, zero observed request failures and page errors, all configured VUs started, at least as many completed iterations as VUs, observed network traffic, and usable resource samples. Resource gates:
| Measurement | Required headroom |
|---|---|
| Sampled generator CPU | Mean <=80% of available logical CPUs |
| Generator process-tree RSS | Peak <=60% of OS RAM |
| Host available-memory estimate | Minimum >=256 MiB |
| Whole-host CPU | Peak sampled utilization <=90% |
| Worker Node event loop | Utilization <=85%, p99 delay <=50ms |
| Sampling | At least 3 observations; gaps <=2.5s; no telemetry error |
Sampling occurs roughly every 500ms and covers the worker and live browser descendants through warmup, startup, measurement and cleanup. CPU is cumulative sampled process time divided by the whole trial window, not steady-state CPU. RSS sums can double-count shared memory; short-lived processes can be missed. Linux uses MemAvailable; macOS estimates free + inactive + speculative pages. Reclaimability is not guaranteed. Other applications and a colocated target affect host metrics. Container CPU/memory quotas are not yet detected; OS totals can overstate their resources. Calibration currently requires macOS/Linux process telemetry; ordinary browser execution retains its existing platform support.
Memory headroom limits trigger cancellation during a trial. CPU/event-loop gates are assessed afterward. Passing indicates an observed level with these checks, not a universal maximum. Run longer soak tests and monitor both generator and target independently before relying on it.
Estimate another machine
When at least three complete passing levels have two or more repeats of >=5s, the model fits median CPU cores and median peak RSS against VUs. Both slopes must be positive and both fits must have R² >=0.8. Otherwise projections are withheld.
node bin/loadstride.js capacity reports/calibration/calibration-TIMESTAMP-ID/calibration.json \
--cpus 16 --memory-gb 32
Replace the path with the generated JSON path. --memory-gb means GiB.
The estimate solves each fitted line against 80% CPU and 60% RAM budgets and
takes the smaller whole-VU bound, capped by the configuration validation limit.
Output includes both bounds, extrapolation status and validated: false. It also
preserves the source sweep’s first failed level and reasons. More CPU/RAM may not
resolve an event-loop or workload failure; the estimate never overrides that result.
This assumes comparable per-core performance and the same flow, browser version, instance count, context lifetime, think time and application response times. CPU and RAM alone cannot predict rendering costs, network limits, target capacity, single-worker event-loop saturation or throughput. A strong fit does not prove causality or accuracy outside the measured range. Recalibrate the destination machine and repeat after changing these settings. Do not publish a generic “8 GB = N VUs” table from one workload.
Diagnose failures separately
HTTP status 0 means no HTTP response was obtained. An unreachable/stopped target,
connection limits, timeouts and resource pressure can all cause failures. Current
source includes transport codes such as ECONNREFUSED in HTTP error samples and
optional response.errorCode values. Check the target logs and generator metrics
before attributing a failure to CPU/RAM. Browser and HTTP capacity are measured
separately; a 1,000-HTTP-VU result does not validate 1,000 browser VUs.
Based on the released v0.2.0 guide. View source on GitHub.