Posts HTTP servers

actix-web vs axum vs Spring Boot vs Express vs Bun vs Apache httpd vs nginx

Seven HTTP servers on 4 Graviton4 cores, 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.

actix-web 4.19.0 led all three JSON routes, at 1.5 times Bun and 1.9 times axum on small JSON. On the 323 KB bodies and the 64 MiB file, every server but Express reached the network's limit..

Small JSON

A 1 KB JSON document built and serialized on every request: the highest rate held at p99 ≤ 50 ms.

actix-web 480,000 responses/s, axum 251,000 responses/s, Spring Boot 128,000 responses/s, Express 107,000 responses/s, Bun 320,000 responses/s

Test 1 Small JSON

The mean of each candidate's samples: the statistic the scorecard ranks this section by.

Small JSON (K responses/s, higher is better)
actix-web480
axum251
Spring Boot128
Express107
Bun320
Small JSON in K responses/s
CandidateValue (K responses/s)Lowest pass (K responses/s)Highest pass (K responses/s)Passes
actix-web4804804803
axum2512402563
Spring Boot1281201443
Express1071041123
Bun3203203203

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, Spring Boot 123,000 responses/s, Express 90,700 responses/s, Bun 267,000 responses/s, Apache httpd 49,300 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.

16 KB body (K responses/s, higher is better)
actix-web352.0
axum352.0
Spring Boot122.7
Express90.7
Bun266.7
Apache httpd49.3
nginx352.0
16 KB body in K responses/s
CandidateValue (K responses/s)Lowest pass (K responses/s)Highest pass (K responses/s)Passes
actix-web352.0352.0352.03
axum352.0352.0352.03
Spring Boot122.7120.0128.03
Express90.788.096.03
Bun266.7256.0288.03
Apache httpd49.344.056.03
nginx352.0352.0352.03

Mean of 3 passes per candidate; the whisker spans the lowest and highest pass; the lead over axum and nginx 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, 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.

323 KB shared body (responses/s, higher is better)
actix-web18,000
axum18,000
Spring Boot18,000
Express13,333
Bun18,000
Apache httpd18,000
nginx18,000
323 KB shared body in responses/s
CandidateValue (responses/s)Lowest pass (responses/s)Highest pass (responses/s)Passes
actix-web18,00018,00018,0003
axum18,00018,00018,0003
Spring Boot18,00018,00018,0003
Express13,33313,00014,0003
Bun18,00018,00018,0003
Apache httpd18,00018,00018,0003
nginx18,00018,00018,0003

Mean of 3 passes per candidate; the whisker spans the lowest and highest pass; the lead over axum, 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, Spring Boot 18,000 responses/s, Express 10,000 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.

323 KB body built per request (responses/s, higher is better)
actix-web18,000
axum18,000
Spring Boot18,000
Express10,000
Bun18,000
323 KB body built per request in responses/s
CandidateValue (responses/s)Lowest pass (responses/s)Highest pass (responses/s)Passes
actix-web18,00018,00018,0003
axum18,00018,00018,0003
Spring Boot18,00018,00018,0003
Express10,00010,00010,0003
Bun18,00018,00018,0003

Mean of 3 passes per candidate; the whisker spans the lowest and highest pass; the lead over axum, 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, Spring Boot 21,300 responses/s, Express 20,000 responses/s, Bun 32,000 responses/s

Test 1 40 KB JSON

The mean of each candidate's samples: the statistic the scorecard ranks this section by.

40 KB JSON (responses/s, higher is better)
actix-web36,000
axum26,667
Spring Boot21,333
Express20,000
Bun32,000
40 KB JSON in responses/s
CandidateValue (responses/s)Lowest pass (responses/s)Highest pass (responses/s)Passes
actix-web36,00036,00036,0003
axum26,66726,00028,0003
Spring Boot21,33320,00022,0003
Express20,00020,00020,0003
Bun32,00032,00032,0003

Mean of 3 passes per candidate; the whisker spans the lowest and highest pass.

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,250 responses/s, Spring Boot 3,250 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.

323 KB JSON (responses/s, higher is better)
actix-web5,000
axum3,250
Spring Boot3,250
Express3,000
Bun4,000
323 KB JSON in responses/s
CandidateValue (responses/s)Lowest pass (responses/s)Highest pass (responses/s)Passes
actix-web5,0005,0005,0003
axum3,2503,2503,2503
Spring Boot3,2503,2503,2503
Express3,0003,0003,0003
Bun4,0004,0004,0003

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 29.5 MB, Spring Boot 113 MB, Express 90.1 MB, Bun 198 MB, Apache httpd 49.1 MB, nginx 17.2 MB

Test 1 Slow clients, 323 KB shared body

The mean of each candidate's samples: the statistic the scorecard ranks this section by.

Slow clients, 323 KB shared body (MB, lower is better)
actix-web17.7
axum29.5
Spring Boot113.3
Express90.1
Bun198.4
Apache httpd49.1
nginx17.2
Slow clients, 323 KB shared body in MB
CandidateValue (MB)Lowest pass (MB)Highest pass (MB)Passes
actix-web17.717.518.03
axum29.529.029.83
Spring Boot113.3107.0123.23
Express90.187.093.43
Bun198.4182.0220.83
Apache httpd49.148.649.43
nginx17.216.617.63

Mean of 3 passes per candidate; the whisker spans the lowest and highest pass; the lead over actix-web is inside the noise.

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 270 MB, axum 288 MB, Spring Boot 424 MB, Express 356 MB, Bun 227 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.

Slow clients, 323 KB body built per request (MB, lower is better)
actix-web270
axum288
Spring Boot424
Express356
Bun227
Slow clients, 323 KB body built per request in MB
CandidateValue (MB)Lowest pass (MB)Highest pass (MB)Passes
actix-web2702592873
axum2882743063
Spring Boot4244094323
Express3563523643
Bun2272052613

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 33.7 MB, Spring Boot 792 MB, Express 323 MB, Bun 79.8 MB

Test 1 Slow clients, 40 KB JSON

The mean of each candidate's samples: the statistic the scorecard ranks this section by.

Slow clients, 40 KB JSON (MB, lower is better)
actix-web50.5
axum33.7
Spring Boot792.3
Express322.6
Bun79.8
Slow clients, 40 KB JSON in MB
CandidateValue (MB)Lowest pass (MB)Highest pass (MB)Passes
actix-web50.550.450.63
axum33.733.034.03
Spring Boot792.3754.6819.33
Express322.6321.0324.33
Bun79.875.482.13

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 227 MB, axum 248 MB, Spring Boot 2,260 MB, Express 492 MB, Bun 279 MB

Test 1 Slow clients, 323 KB JSON

The mean of each candidate's samples: the statistic the scorecard ranks this section by.

Slow clients, 323 KB JSON (MB, lower is better)
actix-web227
axum248
Spring Boot2,261
Express492
Bun279
Slow clients, 323 KB JSON in MB
CandidateValue (MB)Lowest pass (MB)Highest pass (MB)Passes
actix-web2272042523
axum2482342573
Spring Boot2,2612,0762,4593
Express4924455253
Bun2792603023

Mean of 3 passes per candidate; the whisker spans the lowest and highest pass; the lead over axum 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.2 Gbit/s, axum 49.2 Gbit/s, Spring Boot 48.9 Gbit/s, Express 38.4 Gbit/s, Bun 49.2 Gbit/s, Apache httpd 49.2 Gbit/s, nginx 49.1 Gbit/s

Test 1 64 MiB file

The mean of each candidate's samples: the statistic the scorecard ranks this section by.

64 MiB file (Gbit/s, higher is better)
actix-web49.2
axum49.2
Spring Boot48.9
Express38.4
Bun49.2
Apache httpd49.2
nginx49.1
64 MiB file in Gbit/s
CandidateValue (Gbit/s)Lowest pass (Gbit/s)Highest pass (Gbit/s)Passes
actix-web49.249.149.33
axum49.249.149.33
Spring Boot48.948.949.03
Express38.437.938.73
Bun49.249.149.23
Apache httpd49.249.149.33
nginx49.149.149.23

Mean of 3 passes per candidate; the whisker spans the lowest and highest pass; the lead over axum, actix-web, and Bun is inside the noise.

Test conditions: rig, corpus, protocol
Rig
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.99.1, 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
Protocol
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?

actix-web 4.19.0 led all three JSON routes, at 1.5 times Bun and 1.9 times axum on small JSON. On the 323 KB bodies and the 64 MiB file, every server but Express reached the network's limit..

Mean of each section's samples per candidate. The best value in each column is marked in red. A column has no mark when the lead is inside the run's noise, twice the standard error of the difference.
CandidateSmall 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-web480352.018,00018,00036,0005,00017.727050.522749.2
axum251352.018,00018,00026,6673,25029.528833.724849.2
Spring Boot128122.718,00018,00021,3333,250113.3424792.32,26148.9
Express10790.713,33310,00020,0003,00090.1356322.649238.4
Bun320266.718,00018,00032,0004,000198.422779.827949.2
Apache httpd–49.318,000–––49.1–––49.2
nginx–352.018,000–––17.2–––49.1

actix-web answered small JSON on 8.2 µs of CPU a response, against 12.5 for Bun and 14.7 for axum. With 1,000 slow clients on a shared 323 KB body, actix-web and nginx held 18 and 17 MB, axum 30, Apache httpd 49 and Bun 198, while Spring Boot reached 2.3 GB on the 323 KB JSON. On the 16 KB body actix-web, axum and nginx tied at 352,000 responses a second, about 46 Gbit/s. Serving the 64 MiB file, Bun, nginx and Apache httpd spent 2.5 to 3.6 ms of CPU a download, about a tenth of the 25 to 30 ms actix-web, axum and Spring Boot spent.

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.
  • 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,521 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.
  • 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.