Simple Axum (Rust) vs Next.js (Node) “Hello, World” benchmarks on Orange Pi 5 Max

154 points Evgenii42

I ran a quick & silly “Hello, World!” test comparing Axum (Rust) and Next.js (Node).

Hardware: an Orange Pi 5 Max (16 GB RAM, 1 TB NVMe SSD). Benchmarks done with wrk program from a separate desktop PC over 1 Gbps LAN.

Highlights

  • Axum handled ~41k requests/sec at ~27ms latency (no clustering needed - Tokio auto-spins threads equal to CPU cores). Used 32MB of RAM and 2.23 CPU utilization.
  10 threads and 1000 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    27.81ms   26.06ms 482.62ms   96.82%
  24628834 requests in 10.00m, 5.89GB read
Requests/sec:  41044.39
Transfer/sec:     10.06MB
  • Next.js in single-process mode topped ~1.2k requests/sec at ~638ms latency. With clustering, the max output was reached with eight Node processes resulting in ~3.4k requests/sec at ~315ms latency. Used 1.4GB of RAM and 10.30 CPU utilisation.
  10 threads and 1000 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   314.74ms  230.52ms   2.00s    83.49%
  2053154 requests in 10.00m, 522.80MB read
  Socket errors: connect 0, read 0, write 0, timeout 805
Requests/sec:   3421.41
Transfer/sec:      0.87MB
  • These are super bare-bones “Hello, World” tests, not fully representative of real workloads with DB queries, SSR, etc. Also, Rust vs JS are fundamentally different ecosystems, so this is apples-to-orangutans comparison in many ways.

Conclusion

Axum performed about 12x better in raw speed, had 45 times lower RAM usage and 4.5 times lower CPU utilisation.

Source code