Implementation
Axum (test_before_acquire off)
Axum 0.8.9 · Rust · Rust · diagnostic, unranked
frameworks/axum-no-ping on GitHub
Scores
| Category | Position | Score | ± |
|---|---|---|---|
| Hello world | diag. | 0.99*≈ | – |
| Database | diag. | 1.23* | – |
| Application | diag. | 1.15* | – |
| Memory (high-water mark) | diag. | 1.00≈ | – |
| Startup | diag. | 1.00≈ | – |
Runner CPUs: EPYC 9V45, EPYC 7763, EPYC 7763
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 PgPool with test_before_acquire(false) (the baseline keeps SQLx's default, true)
- Templates
- Askama 0.16
- Logging
- none
- Dependency source
- –
- Status
- measured
Notes
- Role: Axum with one change: the SQLx pool does not ping an idle connection before handing it out (PgPoolOptions::test_before_acquire(false); the default is true). It bounds how much the ping costs Axum, and the other SQLx implementations that keep it (Actix Web and Loco; since 13.0.0-rc.1 both Rullst folders ping only connections idle for at least 500 ms), in the database endpoints. SQLx 0.9 also pings every connection when it returns to the pool, whatever this setting; that ping stays. Unranked.
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 | 120,633 (116,073–224,773) | 0.99 | 61,000 | 1.55 | 0 | load-generator-bound 15/15 |
| /json | 116,177 (111,204–222,045) | 1.00 | 58,906 | 1.60 | 0 | load-generator-bound 14/15 |
| /db-single | 14,598 (14,318–33,632) | 1.15 | 11,254 | 9.65 | 0 | PostgreSQL-bound 15/15 |
| /html | 114,285 (105,333–220,577) | 0.99 | 57,648 | 1.64 | 0 | load-generator-bound 5/15 |
| /queries?queries=20 | 916 (879–2,119) | 1.18 | 820 | 139.16 | 0 | PostgreSQL-bound 15/15 |
| /fortunes | 24,209 (23,278–48,158) | 1.23 | 12,342 | 6.46 | 0 | PostgreSQL-bound 15/15 |
| GET /world/{id} | 14,087 (13,499–32,812) | 1.15 | 11,343 | 10.11 | 0 | PostgreSQL-bound 15/15 |
| GET /worlds | 10,796 (10,192–24,394) | 1.12 | 9,715 | 13.20 | 0 | PostgreSQL-bound 15/15 |
| POST /form | 54,044 (51,862–145,298) | 1.01 | 27,111 | 3.40 | 0 | |
| GET /me | 7,691 (7,490–18,100) | 1.16 | 5,775 | 17.83 | 0 | PostgreSQL-bound 15/15 |
| /updates?queries=20 | 396 (384–979) | 1.19 | 413 | 323.17 | 0 | PostgreSQL-bound 15/15 |
| PUT /world/{id} | 11,354 (11,046–28,529) | 1.13 | 9,901 | 12.69 | 0 | PostgreSQL-bound 15/15 |
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 |
|---|---|---|---|
| 1 | EPYC 9V45 | 5 | measured |
| 2 | EPYC 7763 | 5 | measured |
| 3 | EPYC 7763 | 5 | measured |