Posts HTTP servers
actix-web vs axum vs rama vs Spring Boot vs Express vs Bun vs Apache httpd vs nginx
The first post's seven HTTP servers on the same 4 Graviton4 cores, with rama 0.4.0 as an eighth, each at its documented setup: the most responses a second each holds at p99 ≤ 50 ms, what 1,000 slow clients cost it in memory, and how fast it serves a 64 MiB file.
rama 0.4.0 came in behind axum, at 224,000 small-JSON responses a second to axum's 288,000 and Bun's 320,000 and ahead of Spring Boot and Express, and actix-web led small and 323 KB JSON again.
Small JSON
A 1 KB JSON document built and serialized on every request: the highest rate held at p99 ≤ 50 ms.
actix-web 491,000 responses/s, axum 272,000 responses/s, rama 219,000 responses/s, Spring Boot 128,000 responses/s, Express 107,000 responses/s, Bun 309,000 responses/s
Test 1 Small JSON
The mean of each candidate's samples: the statistic the scorecard ranks this section by.
Mean of 3 passes per candidate; the whisker spans the lowest and highest pass.
16 KB body
16,384 bytes from one shared buffer, or a file for Apache httpd and nginx, under actix-web's 32 KiB write-buffer threshold.
actix-web 352,000 responses/s, axum 352,000 responses/s, rama 331,000 responses/s, Spring Boot 115,000 responses/s, Express 90,700 responses/s, Bun 267,000 responses/s, Apache httpd 48,000 responses/s, nginx 352,000 responses/s
Test 1 16 KB body
The mean of each candidate's samples: the statistic the scorecard ranks this section by.
Mean of 3 passes per candidate; the whisker spans the lowest and highest pass; the lead over axum, nginx, and rama is inside the noise.
323 KB shared body
323,000 bytes cloned from one shared buffer, as a server answers from a cache, or a file for Apache httpd and nginx.
actix-web 18,000 responses/s, axum 18,000 responses/s, rama 18,000 responses/s, Spring Boot 18,000 responses/s, Express 13,300 responses/s, Bun 18,000 responses/s, Apache httpd 18,000 responses/s, nginx 18,000 responses/s
Test 1 323 KB shared body
The mean of each candidate's samples: the statistic the scorecard ranks this section by.
Mean of 3 passes per candidate; the whisker spans the lowest and highest pass; the lead over axum, rama, Spring Boot, Bun, Apache httpd, and nginx is inside the noise.
323 KB body built per request
The same 323,000 bytes copied into a new buffer on every request.
actix-web 18,000 responses/s, axum 18,000 responses/s, rama 18,000 responses/s, Spring Boot 18,000 responses/s, Express 10,300 responses/s, Bun 18,000 responses/s
Test 1 323 KB body built per request
The mean of each candidate's samples: the statistic the scorecard ranks this section by.
Mean of 3 passes per candidate; the whisker spans the lowest and highest pass; the lead over axum, rama, Spring Boot, and Bun is inside the noise.
40 KB JSON
A 263-item JSON document, 40,039 bytes, built and serialized on every request.
actix-web 36,000 responses/s, axum 26,700 responses/s, rama 22,000 responses/s, Spring Boot 15,000 responses/s, Express 20,000 responses/s, Bun 34,700 responses/s
Test 1 40 KB JSON
The mean of each candidate's samples: the statistic the scorecard ranks this section by.
Mean of 3 passes per candidate; the whisker spans the lowest and highest pass; the lead over Bun is inside the noise.
323 KB JSON
A 2,100-item JSON document, 323,142 bytes, built and serialized on every request.
actix-web 5,000 responses/s, axum 3,330 responses/s, rama 3,250 responses/s, Spring Boot 3,080 responses/s, Express 3,000 responses/s, Bun 4,000 responses/s
Test 1 323 KB JSON
The mean of each candidate's samples: the statistic the scorecard ranks this section by.
Mean of 3 passes per candidate; the whisker spans the lowest and highest pass.
Slow clients, 323 KB shared body
Peak memory growth with 1,000 keep-alive clients, each paced at 10 Mbit/s with 40 ms added round trip.
actix-web 17.7 MB, axum 28.6 MB, rama 27.7 MB, Spring Boot 102 MB, Express 88 MB, Bun 181 MB, Apache httpd 50.5 MB, nginx 16.9 MB
Test 1 Slow clients, 323 KB shared body
The mean of each candidate's samples: the statistic the scorecard ranks this section by.
Mean of 3 passes per candidate; the whisker spans the lowest and highest pass.
Slow clients, 323 KB body built per request
Peak memory growth with 1,000 slow keep-alive clients on the per-request body.
actix-web 250 MB, axum 278 MB, rama 274 MB, Spring Boot 438 MB, Express 355 MB, Bun 216 MB
Test 1 Slow clients, 323 KB body built per request
The mean of each candidate's samples: the statistic the scorecard ranks this section by.
Mean of 3 passes per candidate; the whisker spans the lowest and highest pass.
Slow clients, 40 KB JSON
Peak memory growth with 1,000 slow keep-alive clients on the 40 KB JSON document.
actix-web 50.5 MB, axum 35.3 MB, rama 32 MB, Spring Boot 829 MB, Express 307 MB, Bun 78.5 MB
Test 1 Slow clients, 40 KB JSON
The mean of each candidate's samples: the statistic the scorecard ranks this section by.
Mean of 3 passes per candidate; the whisker spans the lowest and highest pass.
Slow clients, 323 KB JSON
Peak memory growth with 1,000 slow keep-alive clients on the 323 KB JSON document.
actix-web 197 MB, axum 203 MB, rama 218 MB, Spring Boot 2,030 MB, Express 525 MB, Bun 266 MB
Test 1 Slow clients, 323 KB JSON
The mean of each candidate's samples: the statistic the scorecard ranks this section by.
Mean of 3 passes per candidate; the whisker spans the lowest and highest pass; the lead over axum and rama is inside the noise.
64 MiB file
64 keep-alive clients downloading a 64 MiB file through each server's own file serving, nothing shaped.
actix-web 49.1 Gbit/s, axum 49.2 Gbit/s, rama 49.1 Gbit/s, Spring Boot 49.1 Gbit/s, Express 38.6 Gbit/s, Bun 49.1 Gbit/s, Apache httpd 49.1 Gbit/s, nginx 49.2 Gbit/s
Test 1 64 MiB file
The mean of each candidate's samples: the statistic the scorecard ranks this section by.
Mean of 3 passes per candidate; the whisker spans the lowest and highest pass; the lead over axum, Apache httpd, rama, and Bun is inside the noise.
Test conditions: rig, corpus, protocol
- Machine
- AWS c8gn.4xlarge server, its processes pinned to 4 of 16 cores, and a c8gn.4xlarge client, one cluster placement group
- Chip
- AWS Graviton4
- Cores
- 4 (server)
- Memory
- 32 GiB each
- OS
- Ubuntu 24.04 LTS arm64, kernel 7.0.0-1014-aws (arm64)
- Runtime
- Each server at its documented setup: Rust release builds with rustc 1.100.0, OpenJDK 25.0.5, Node.js 26.13.0, Bun 1.4.4, Apache httpd 2.4.58 and nginx 1.30.6; oha 1.16.0; plain HTTP/1.1 keep-alive, no TLS, 50 Gbps between the instances
- Warmups
- 3 unmeasured passes
- Measured
- 3 passes per tool
- Process
- A fresh server process group per cell on the server's 4 cores, each server sizing its own workers; every server but Bun listens with actix-web's backlog of 1,024 from its own settings, since Bun.serve has none
- Cache
- JSON built on every request; byte bodies from one shared buffer, or a new one per request on /323k-fresh, while Apache httpd and nginx serve them as files; the 64 MiB file stays in the page cache
- Output
- Capacity: the highest open-loop rate held with p99 at most 50 ms, at most 0.1% errors and at least 95% delivered, doubling then bisecting three times; CPU per response from the server's user plus system time and peak memory growth from VmHWM, each summed over its processes
What did we learn?
rama 0.4.0 came in behind axum, at 224,000 small-JSON responses a second to axum's 288,000 and Bun's 320,000 and ahead of Spring Boot and Express, and actix-web led small and 323 KB JSON again.
| Candidate | Small JSON (K responses/s, higher is better) | 16 KB body (K responses/s, higher is better) | 323 KB shared body (responses/s, higher is better) | 323 KB body built per request (responses/s, higher is better) | 40 KB JSON (responses/s, higher is better) | 323 KB JSON (responses/s, higher is better) | Slow clients, 323 KB shared body (MB, lower is better) | Slow clients, 323 KB body built per request (MB, lower is better) | Slow clients, 40 KB JSON (MB, lower is better) | Slow clients, 323 KB JSON (MB, lower is better) | 64 MiB file (Gbit/s, higher is better) |
|---|---|---|---|---|---|---|---|---|---|---|---|
| actix-web | 491 | 352.0 | 18,000 | 18,000 | 36,000 | 5,000 | 17.7 | 250 | 50.5 | 197 | 49.1 |
| axum | 272 | 352.0 | 18,000 | 18,000 | 26,667 | 3,333 | 28.6 | 278 | 35.3 | 203 | 49.2 |
| rama | 219 | 330.7 | 18,000 | 18,000 | 22,000 | 3,250 | 27.7 | 274 | 32.0 | 218 | 49.1 |
| Spring Boot | 128 | 114.7 | 18,000 | 18,000 | 15,000 | 3,083 | 101.8 | 438 | 829.0 | 2,033 | 49.1 |
| Express | 107 | 90.7 | 13,333 | 10,333 | 20,000 | 3,000 | 88.0 | 355 | 307.4 | 525 | 38.6 |
| Bun | 309 | 266.7 | 18,000 | 18,000 | 34,667 | 4,000 | 181.3 | 216 | 78.5 | 266 | 49.1 |
| Apache httpd | – | 48.0 | 18,000 | – | – | – | 50.5 | – | – | – | 49.1 |
| nginx | – | 352.0 | 18,000 | – | – | – | 16.9 | – | – | – | 49.2 |
rama spent 16.8 µs of CPU a small-JSON response against axum's 13.1, and on 40 KB JSON it held 22,000 responses a second to axum's 26,000, at 174 µs a response to axum's 151. On 323 KB JSON the two were close: 3,250 against 3,500, at 1,165 and 1,128 µs. On the 16 KB body rama reached the link's 352,000 in one pass and held 320,000 in the other two, where actix-web, axum and nginx held 352,000 in all three. It reached the network's limit on the 323 KB bodies and the file like every server but Express, at 30.4 ms of CPU a download, the same as axum, and with 1,000 slow clients its memory stayed near axum's: 28 MB to 29 on the shared 323 KB body. The seven servers from the first post landed within a capacity step of their numbers then, apart from Spring Boot, whose 40 KB JSON fell from 22,000 to 15,000 responses a second. Medians of three passes; the section lines show means.
What this does not prove
- The server ran on 4 of a c8gn.4xlarge's 16 Graviton4 cores, with its client on a second c8gn.4xlarge in the same placement group: one instance size, one architecture, plain HTTP/1.1 and no TLS.
- Every server ran its documented setup without tuning, Spring Boot with no JVM flags. Every server but Bun takes actix-web's listen backlog of 1,024 from its own settings; Bun.serve has no such setting.
- rama turns on its http-full feature, the one its docs build HTTP servers with, since its default features hold no HTTP, and otherwise runs as shipped: Nagle on, and cleartext HTTP/2 detected on every connection. Its author, Glen De Cauwsemaecker, wrote its server the way rama's examples are (http-servers#13).
- This is rama 0.4.0, its newest release when it ran; 0.5 hadn't shipped.
- Apache httpd and nginx serve files, not code, so they sit out the JSON routes and the body built per request.
- The fastest servers reached the 50 Gbps link on the 16 KB and 323 KB bodies and on the file (46 to 49 Gbit/s), so those routes have no winner; they show who falls short of it.
- Capacity is found by doubling the offered rate and then bisecting three times, so two servers within an eighth of each other can land on the same step.
- Apache httpd, at the 150 workers Ubuntu's packaged configuration allows, served the 1,000 slow clients at 1,511 responses a second against about 3,400 for the rest, with a 30-second p99.
- Three passes, each on a fresh pair of instances. A route has a winner only when the passes' 95% intervals don't overlap.
- Peak memory growth is VmHWM summed over a server's processes, so Express, Bun, Apache httpd and nginx, which run several, count each one's peak.
- Against the 2026-11-09 post: the same rig and setups on new instance pairs, a newer Ubuntu image on the same kernel, and rustc 1.100.0 in place of 1.99.1 for the three Rust servers. Spring Boot's 40 KB JSON fell from 22,000 to 15,000 responses a second and its CPU per response rose 11% on both larger JSON routes; its JDK was the same, and nothing the run records explains it.
- I wrote actix-web #4302 and #4404, the changes in actix-http 3.21.0 that stop copying large response bodies into the write buffer.
Rerun it yourself: the runner and configuration are in the repository, and the methodology page covers what every run holds constant. Think a result is wrong? Open an issue with your rig and your samples.
actix-web is a project of the actix organization. axum is a project of the tokio-rs organization. rama is a project of Plabayo. Spring is a trademark of Broadcom Inc. and/or its subsidiaries. Express and Node.js are projects of the OpenJS Foundation. Bun is part of Anthropic. Apache and Apache HTTP Server are trademarks of The Apache Software Foundation. NGINX is a trademark of F5, Inc. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.