| Crates.io | armchair |
| lib.rs | armchair |
| version | 0.3.0 |
| created_at | 2025-10-16 08:05:26.91467+00 |
| updated_at | 2026-01-21 08:57:39.554605+00 |
| description | Concurrency benchmarking tool for Rime TTS services |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1885600 |
| size | 123,636 |
Armchair is a load test binary that can be used to benchmark Rime's TTS service with concurrent requests.
Primary use cases:
For audio streaming with concurrent sessions, TTFB and RTF are the key performance indicators. To achieve real-time streaming, it is imperative that RTF is under 1 and a maximum concurrency is typically imposed to ensure that RTF is under 1.
Supported features:
This tool simulates many concurrent streaming sessions and evaluates performance against a configurable target.
Session model:
--session-rate, starts/second).-n/--requests-per-session sequential requests.Per-request timing and metrics:
Intra-session delay model (traffic shaping):
--intra-session-delay-mu and --intra-session-delay-sigma, truncated to [--intra-session-delay-min, --intra-session-delay-max].Buffer underrun detection:
--client-buffer (default 0ms).Aggregation and statistics:
Performance target evaluation (--target):
success:<fraction>, ttfb:pXX@<duration>, rtf:pXX@<value>, underrun:<fraction>.Maximum concurrency search (when --concurrency is omitted):
Note: The traffic and delay processes are stochastic; repeated runs will vary. Randomness is seeded from system entropy.
cargo install armchair
To find the maximum concurrency where each session sends 5 requests with:
success:1.00,ttfb:p99@1s,rtf:p99@1.00,underrun:0.00 (default)armchair --url '<RIME_SERVICE>' --token '<RIME_API_KEY>'
The tool should then report metrics like:
=== MAXIMUM CONCURRENCY FOUND: 16 ===
...
----- Summary -----
concurrency: 16
total: 80 success: 80 (100.0%)
Buffer underrun: 0 (0.0%)
TTFB ms: mean=104.4 p50=100.8 p90=117.6 p95=126.2 p99=141.0
Elapsed ms: mean=13924.0 p50=13772.5 p90=16412.8 p95=17065.3 p99=18527.3
RTF: mean=1.067 p50=1.061 p90=1.170 p95=1.208 p99=1.254
By specifying the flag --concurrency, the tool skips the bisection and simply
produces the latency metrics.
-n: Number of requests in each session, e.g. 5--session-rate: Session starts per second following a Poisson distribution for staggered starts, e.g. 5--intra-session-delay-mu: Intra-session delay mean, e.g. 10s--intra-session-delay-sigma: Intra-session delay standard deviation, e.g. 5s--intra-session-delay-min: Intra-session delay minimum clamp, e.g. 0s--intra-session-delay-max: Intra-session delay maximum clamp, e.g. 20s--client-buffer: Client-side initial playback buffer, e.g. 100ms--prepend-request-id: If set, prepend req-x-y to the request text to avoid cache hits (default: false)--target: Performance target specification, e.g. success:1.00,ttfb:p90@500ms,rtf:p90@1.00,underrun:0.00--percentiles: List of percentiles to report, e.g. 1,25,50,90,99Flags that accept durations (e.g., --intra-session-delay-mu) take values with units:
500ms, 1.5s, 10s
--target accepts a comma-separated list:
success:<fraction>,ttfb:pXX@<duration>,rtf:pXX@<value>,underrun:<fraction>
Examples:
--target success:0.99,ttfb:p95@800ms,rtf:p90@1.20,underrun:0.01
--target success:1.00,ttfb:p90@1s,rtf:p90@1.00,underrun:0.00
Armchair chooses the request text in the following order:
--text: use this text for every request--inputs <PATH>: read PATH and pick a non-empty line uniformly at random per requestNote: --text and --inputs are mutually exclusive.
Use --dump <DIR> to dump the response body for every request.
armchair-YYYYMMDD-HHmmss (UTC) inside <DIR>.req-x-y.in containing the request textreq-x-y.wav if the request is successfulreq-x-y.out if the request is an error (HTTP error or request failure)