English
Load-Test Tool: Architecture
This page explains where load comes from, which components it lands on, where data comes from, and how metrics are collected. It does not cover code structure.
Component Boundaries
| Role | Responsibility | Boundary |
|---|---|---|
| Load generator host | Generates requests, computes metrics, generates data, produces reports | Outbound only; installs no agent inside the application under test |
| Main app | Target under load; carries order placement, refund, and callbacks | The tool never changes its configuration or data; read-only sampling |
| Channel sub-app + Mock Channel | Absorb payment results so the chain is complete | Mock side: automatic callbacks off, capacity raised |
| Dedicated load-test database | Landing point for data generation and consistency checks | Separate database; the tool never switches databases |
Data Plane vs Control Plane
| Plane | Path | Why not share one path |
|---|---|---|
| Load-generation plane | HTTP open API (after signing) | Only the real business entry measures the real signing, signature verification, and persistence overhead |
| Data plane | Direct PostgreSQL connection, batch COPY writes | Generating millions of orders through the API is impractical and should not count toward throughput |
| Sampling plane | actuator, pg_stat, Redis INFO, local host | Read-only observation, outside the business chain |
Metric Pipeline
Three definitions must not be mixed up:
- Stable ceiling: the highest TPS that continuously meets the SLA (P99, error rate, backpressure);
- Breaking point: the first tier that fails;
- Recommended capacity: stable ceiling × 0.7.
Samples taken during a run are persisted per step (steps.jsonl); the step summary and slowest-step curve in the report are generated from it and can be re-checked afterwards.
Design Constraints
| Constraint | Reason |
|---|---|
| Single binary with embedded console | No Node and no build chain on the load generator host; copy one exe and run |
Intranet targets enforced, database names containing prod rejected | Load testing writes data; pointing at production would pollute real data |
| No database switching, no configuration changes | Switching databases requires restarting the main app, which the operator must do explicitly and confirm |
| Manual triggering, no scheduled jobs | Resource usage and data writes during a run cannot be scheduled automatically |
| End-to-end key masking | Reports go to the accepting party and must not carry any key material |