Stress tests
Kevlar and Polly v8 run the same composed timeout, retry, and circuit-breaker workload under sustained parallel load. Alternating measurement rounds run in a single process, so they use the same GitHub runner while balancing early- and late-run conditions.
Last updated 2026-12-01 15:03 UTC (commit 7cbee97).
note
Shared CI runners vary. Treat one run as a sustained-load health check, not a universal capacity claim. Compare ratios and allocation behavior, then measure your own workload.
Latest result
| Scenario | Workers | Library | Throughput | CPU | Allocated | Allocated/op | GC pause | GC collections (0 / 1 / 2) | Process lock contentions |
|---|---|---|---|---|---|---|---|---|---|
| Shared timeout → retry → ratio breaker | 1 | Kevlar | 3.23M ops/s | 100% | 6.98 KiB | 0.00 B | 0.00 ms | 0 / 0 / 0 | 0 |
| Shared timeout → retry → ratio breaker | 1 | Polly | 2.22M ops/s | 100% | 8.93 GiB | 48.00 B | 35.43 ms | 112 / 8 / 0 | 0 |
| Shared timeout → retry → ratio breaker | 4 | Kevlar | 6.78M ops/s | 398% | 10.67 KiB | 0.00 B | 0.00 ms | 0 / 0 / 0 | 14 |
| Shared timeout → retry → ratio breaker | 4 | Polly | 3.07M ops/s | 397% | 12.37 GiB | 48.00 B | 59.42 ms | 156 / 8 / 0 | 2.74K |
| Shared timeout → retry | 4 | Kevlar | 14.88M ops/s | 398% | 8.72 KiB | 0.00 B | 0.00 ms | 0 / 0 / 0 | 0 |
| Shared timeout → retry | 4 | Polly | 3.63M ops/s | 398% | 7.30 GiB | 24.00 B | 35.08 ms | 92 / 4 / 0 | 5 |
| Per-worker timeout → retry → ratio breaker | 4 | Kevlar | 10.20M ops/s | 399% | 14.92 KiB | 0.00 B | 0.00 ms | 0 / 0 / 0 | 0 |
| Per-worker timeout → retry → ratio breaker | 4 | Polly | 3.25M ops/s | 398% | 13.09 GiB | 48.00 B | 61.95 ms | 167 / 8 / 0 | 4 |
| Shared open breaker — every call rejected | 4 | Kevlar | 19.68M ops/s | 396% | 237.53 GiB | 144.00 B | 717.62 ms | 3099 / 8 / 0 | 0 |
| Shared open breaker — every call rejected | 4 | Polly | 3.87M ops/s | 396% | 64.82 GiB | 200.00 B | 284.81 ms | 829 / 8 / 0 | 131.90K |
Comparisons
| Scenario | Workers | Kevlar / Polly throughput |
|---|---|---|
| Shared timeout → retry → ratio breaker | 1 | 1.46× |
| Shared timeout → retry → ratio breaker | 4 | 2.21× |
| Shared timeout → retry | 4 | 4.10× |
| Per-worker timeout → retry → ratio breaker | 4 | 3.14× |
| Shared open breaker — every call rejected | 4 | 5.09× |
Method
- 1 and 4 parallel workers; 15 minutes total measured time, split equally between scenarios and libraries across 4 alternating rounds.
- Each scenario and library warmed for 2 seconds before measurement.
- Shared and per-worker ratio-breaker scenarios run Timeout(10 s) → Retry(3, no delay) → CircuitBreaker(10% over 30 s, min 100, break 5 s).
- Timeout/retry isolates pipeline overhead from circuit-breaker shared-state contention.
- The shared open-breaker scenario trips one breaker for the whole run, so every call measures contended fast-fail rejection.
- Process-wide CPU, allocation, GC pause, collection, and managed-lock contention counters are captured separately for each phase.
- Peak working set for the shared process: 146.79 MiB.
Environment
- Ubuntu 26.04.1 LTS
- .NET 11.0.0
- 4 logical processors visible to .NET
Reproduce
dotnet run -c Release --project benchmarks/Kevlar.StressTests -- --duration 00:15:00
Use --workers, --warmup, and --output to override the defaults. The stress workflow runs weekly and republishes this page.