Implementation
Axum
Axum 0.8.9 · Rust · Rust · reference
Scores
| Category | Position | Score | ± |
|---|---|---|---|
| Hello world | ref. | 1.00 | – |
| Database | ref. | 1.00 | – |
| Application | ref. | 1.00 | – |
| Memory (high-water mark) | ref. | 1.00 | – |
| Startup | ref. | 1.00 | – |
Runner CPUs: EPYC 9V74 ×19, EPYC 7763 ×17, EPYC 9V45 ×6, Xeon 6975P-C ×5, Xeon PLATINUM 8573C ×3, Xeon Platinum 8370C CPU @ 2.80GHz ×1
Settings
- Runtime
- Rust 1.99.1 (release build, thin LTO)
- Server
- Hyper via axum::serve
- Workers
- Tokio multi-threaded runtime, one worker per available CPU (2)
- Database layer
- SQLx 0.9 (Axum has no ORM; its examples use SQLx)
- Templates
- Askama 0.16
- Logging
- none
- Dependency source
- –
- Status
- measured
Application endpoints: mechanisms
- Validation
- Path, Query, Json and Form extractors (type errors: 400, Json data errors 422); ranges checked by hand (422)
- CSRF
- token (library): axum_csrf 0.12 (token in an encrypted cookie, HMAC in the form field)
- Session store
- postgresql (library): tower-sessions 0.15 with tower-sessions-sqlx-store 0.16 PostgresStore
Tier 1 endpoints
| Endpoint | req/s | vs Axum | Efficiency (req/CPU-s) | p99 (ms) | Errors | Limits |
|---|---|---|---|---|---|---|
| /text | 166,105 (110,610–286,539) | 1.00 | 84,088 | 1.13 | 0 | load-generator-bound 236/255 |
| /json | 162,890 (108,887–280,048) | 1.00 | 82,281 | 1.15 | 0 | load-generator-bound 207/255 |
| /db-single | 18,251 (12,130–35,084) | 1.00 | 13,587 | 8.20 | 0 | PostgreSQL-bound 255/255 |
| /html | 158,246 (102,787–272,689) | 1.00 | 80,005 | 1.18 | 0 | load-generator-bound 164/255 |
| /queries?queries=20 | 1,090 (742–2,173) | 1.00 | 917 | 124.97 | 0 | PostgreSQL-bound 255/255 |
| /fortunes | 27,329 (17,780–43,703) | 1.00 | 14,143 | 6.96 | 0 | PostgreSQL-bound 255/255 |
| GET /world/{id} | 17,505 (11,490–33,647) | 1.00 | 13,514 | 8.32 | 0 | PostgreSQL-bound 255/255 |
| GET /worlds | 13,418 (7,780–22,840) | 1.00 | 11,633 | 11.22 | 0 | PostgreSQL-bound 255/255 |
| POST /form | 83,772 (49,849–147,613) | 1.00 | 41,953 | 2.15 | 0 | |
| GET /me | 9,354 (6,189–18,187) | 1.00 | 6,760 | 16.37 | 0 | PostgreSQL-bound 255/255 |
| /updates?queries=20 | 471 (322–979) | 1.00 | 459 | 273.06 | 0 | PostgreSQL-bound 255/255 |
| PUT /world/{id} | 14,086 (9,501–27,613) | 1.00 | 11,996 | 10.55 | 0 | PostgreSQL-bound 255/255 |
Measured versions
argon20.6.0askama0.16.1axum0.8.9axum_csrf0.12.0hyper1.12.0sqlx0.9.0tokio1.54.1tower-sessions0.15.0tower-sessions-sqlx-store0.16.0
Runner jobs
| Job | CPU model | Rounds | Status |
|---|