- Shell 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| images | ||
| benchmark.sh | ||
| README.md | ||
ProxyAuth Benchmark
A lightweight load-testing harness for ProxyAuth, built around OHA.
The benchmark authenticates multiple independent clients, obtains a ProxyAuth access token for each client, then starts the authenticated load tests simultaneously.
How it works
The benchmark runs in two phases:
1. Authentication
Each benchmark instance authenticates sequentially against the configured authentication endpoint.
Authentication requests are deliberately spaced out because the authentication endpoint may be rate-limited.
Each successful authentication produces a token stored temporarily for the corresponding benchmark instance.
If authentication fails, the instance is marked as failed and is excluded from the load test.
2. Load testing
All successfully authenticated instances then start their OHA workers simultaneously.
Each instance has its own:
- Authentication token
- Request rate
- Request count
- Concurrency limit
- OHA log
For example, with:
10 instances
1 request/sec per instance
20 requests per instance
100 concurrency per instance
the benchmark targets:
10 requests/sec
200 total requests
100 concurrency per instance
If only 8 instances authenticate successfully, the target automatically becomes:
8 requests/sec
160 total requests
The benchmark never counts failed authentication instances as active load generators.
Requirements
The benchmark requires:
- Bash
curljqoha
Install OHA with:
cargo install oha
On Debian/Ubuntu:
sudo apt install curl jq
Usage
Run the benchmark with the default configuration:
./benchmark.sh
Display the available options:
./benchmark.sh --help
Options
| Option | Description | Default |
|---|---|---|
--url URL |
Target URL | https://demo.proxyauth.app/app |
--auth-url URL |
Authentication URL | https://demo.proxyauth.app/auth |
--instances N |
Number of benchmark instances | 10 |
--rate N |
Requests/sec per instance | 1 |
--requests N |
Requests per instance | 20 |
--concurrency N |
Concurrency per instance | 100 |
--summary-test |
Parse existing OHA logs without running a benchmark | — |
--help, -h |
Display help | — |
Examples
Benchmark the default target:
./benchmark.sh
Use a different target:
./benchmark.sh \
--url https://example.com/app
Configure both the application and authentication endpoints:
./benchmark.sh \
--url https://example.com/app \
--auth-url https://example.com/auth
Run a larger test:
./benchmark.sh \
--url https://example.com/app \
--auth-url https://example.com/auth \
--instances 20 \
--rate 5 \
--requests 100 \
--concurrency 200
This configuration targets:
20 × 5 req/s = 100 req/s
20 × 100 req = 2,000 requests
Authentication
The authentication phase uses the configured credentials and retries failed authentication attempts up to three times.
The terminal UI shows the state of every instance:
✓ authenticated
● authenticating
↻ Retry
✗ authentication failed
○ waiting
Authentication failures do not stop the complete benchmark.
If no instance can authenticate successfully, the benchmark exits without starting OHA.
Logs
Each authenticated instance produces its own OHA log:
logs/
├── oha-1.log
├── oha-2.log
├── oha-3.log
├── ...
└── oha-10.log
This makes it possible to inspect individual instances independently.
Summary testing
Existing OHA logs can be analysed without running another benchmark:
./benchmark.sh --summary-test
The summary parser aggregates the available OHA information and reports:
- Total requests
- Completed HTTP responses
- Failed/time-out requests
- Completion rate
- Global wall time
- Global requests/sec
- Weighted average latency
- Total transferred data
- Data per request
- Data per second
- HTTP status distribution
For example:
ProxyAuth OHA Summary
────────────────────────────────────────
Instances : 10
Total requests : 1000
Completed HTTP : 857
Failed / timeout : 143
Completion rate : 85.70%
Wall time : 15.71 s
Global requests/sec : 63.65
Weighted average : ...
Total data : 15.94 MiB
Percentiles
Exact global latency percentiles cannot be reconstructed from OHA summary output alone.
The benchmark therefore does not attempt to fabricate global P50, P95 or P99 values from per-instance summaries.
For percentile analysis, inspect the individual OHA output or collect the underlying request-level measurements.
Benchmark model
The important distinction is between configured instances and authenticated instances.
The effective load is:
Effective rate
= authenticated instances × rate
Target requests
= authenticated instances × requests
This means authentication failures automatically reduce the generated load.
The benchmark also starts the authenticated OHA instances concurrently, so the measured wall-clock duration represents the parallel execution of the instances rather than the sum of their individual durations.
Output
The benchmark keeps the authentication phase interactive while maintaining a compact terminal UI.
After authentication, it displays the effective configuration before starting OHA:
ProxyAuth Oha Load Test
────────────────────────────────────────
Target URL : https://demo.example.com/app
Authentication URL : https://demo.example.app/auth
Instances : 10
Authenticated : 10
Authentication fail : 0
Rate / instance : 1 req/s
Target total rate : 10 req/s
Requests / instance : 20
Total target req. : 200
Concurrency / inst. : 100
The benchmark is intentionally designed to make the relationship between authentication, generated load and final measurements explicit.