Skip to content
zuri-langPublic

About

HTTP Benchmark Suite & Report: HTTP/1.1 & HTTP/2 Performance

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

8 Commits

Folders and files

Repository files navigation

HTTP Benchmark: HTTP/1.1 and HTTP/2

This suite measures the throughput, latency, CPU time and memory of HTTP servers over HTTP/1.1 and cleartext HTTP/2 (h2c). It compares Zuri's http module, run on one thread with listen() and across all cores with http.serve(), with HTTP servers for six other runtimes:

Name Server Cores used
zuri Zuri http.server with listen() 1
zuri-serve Zuri http.serve(), one worker isolate per core all 10
rs Rust, hyper on tokio's multi-threaded runtime all 10
go Go, net/http with x/net/http2/h2c all 10
node Node.js, node:http and node:http2 1
rb Ruby with YJIT, Falcon with one forked worker 1
pypy PyPy, Hypercorn 1
py CPython, Hypercorn 1

Rust, Go and zuri-serve spread their connections over all 10 cores, and the other five serve all of theirs on one thread. A comparison is fairest within each group.

Zuri's Brotli compression is turned off (server.compression = false), since none of the other servers compress their responses. SPEC.md describes the workloads, and how to set up each runtime.

How It Was Measured

  • A case is one runtime, one protocol and one workload. The workloads are plaintext (GET /plaintext), JSON (GET /json) and echo (POST /echo with a 100-byte body).
  • h2load sends 100,000 requests over 25 connections, with up to 10 streams at a time on each connection over HTTP/2. It runs on the same machine as the server, on one thread.
  • Each measured run follows 4 untimed runs of the same load against the same server process, so the results are for a warm server. By the measured run, no server was still getting faster. For each runtime, the measured run averaged 0.99 to 1.05 times the throughput of the last warm-up run.
  • Each case was run 3 times, 144 runs in all, and all requests in all runs succeeded.
  • The runs started once the 1-minute load average was below 1.5. The machine was on mains power and didn't sleep during them.
  • Peak is the highest throughput of any one run. Mean is the average over a runtime's 18 runs, or its 9 runs on one protocol or 6 on one workload.
  • CPU per run is the CPU time the server used during one measured run of 100,000 requests, averaged over its runs.
  • Memory is the largest resident size at the end of a run. macOS keeps no peak for another process, so this is the size when the load ends.
  • CPU and memory are added up over the server's process and any processes it started, since Falcon serves from a forked worker.

Machine

Model:   MacBook Pro (Mac17,2)
Chip:    Apple M5, 10 cores (4 Super, 6 Efficiency)
Memory:  16 GB
OS:      macOS 26.5.1 (25F80), Darwin 25.5.0, arm64
Client:  h2load (nghttp2 1.70.0), one thread, on the same machine
Runtime Version
Zuri 0.1.0, dev branch at 25379ee
Node.js 26.12.1
CPython 3.14.10, Hypercorn 0.18.0
PyPy 3.11.17 (PyPy 8.0.1), Hypercorn 0.18.0
Ruby 4.0.6 with YJIT, Falcon 0.57.0
Go 1.27.4, x/net 0.61.0
Rust 1.99.1, hyper 1.12.0, tokio 1.53.3

Results will differ on other machines and architectures.


1. Summary

  • Across all cores, Rust has the highest mean throughput, 408,497 req/s, with zuri-serve close behind at 404,884 req/s. zuri-serve is ahead of Rust on HTTP/2 echo (568,380 against 499,220 req/s) and has the fastest single run, 703,482 req/s on HTTP/2 JSON. Go averages 173,730 req/s, and uses the most CPU per run of the three.
  • On one thread, Node.js leads with 181,557 req/s, followed by Zuri's listen() at 157,080 req/s. zuri is ahead of Node.js on HTTP/1.1 echo (132,743 against 117,795 req/s). Ruby, PyPy and CPython follow at 44,402, 22,547 and 15,909 req/s.
  • http.serve() against listen(): spreading the work over 10 cores is 1.33x to 1.41x as fast over HTTP/1.1 and 3.28x to 3.81x as fast over HTTP/2. It costs about 3.2 times the CPU per run over HTTP/1.1 and 1.8 times over HTTP/2, and 780.5 MB of memory against 152.5 MB, since each worker has its own heap.
  • HTTP/2 is faster than HTTP/1.1 for Zuri, Rust, Node.js and Go, and slower for Ruby, PyPy and CPython.
  • Latency is lowest for Rust and zuri-serve, at 0.20 and 0.23 ms. Among the single-threaded servers, Node.js averages 0.65 ms and zuri 0.78 ms.
  • Memory is lowest for Rust at 9.7 MB, and highest for zuri-serve.

2. Overall Ranking

Rank Runtime Cores Peak (req/s) Mean (req/s) Mean latency (ms) Memory (MB) CPU per run (s)
1 Rust (rs) all 684,533 408,497 0.20 9.7 1.05
2 Zuri http.serve() (zuri-serve) all 703,482 404,884 0.23 780.5 1.66
3 Node.js (node) 1 233,848 181,557 0.65 215.8 0.60
4 Go (go) all 233,854 173,730 0.82 46.6 3.47
5 Zuri listen() (zuri) 1 184,472 157,080 0.78 152.5 0.65
6 Ruby (rb) 1 69,659 44,402 5.29 159.8 2.82
7 PyPy (pypy) 1 26,474 22,547 6.35 162.4 4.38
8 CPython (py) 1 18,981 15,909 9.43 54.0 6.33

The ranking is by mean throughput.

Peak Throughput

Peak Throughput Ranking

Average Throughput

Average Throughput Ranking


3. All Cases

Mean throughput for each case, in req/s:

Case rs zuri-serve node go zuri rb pypy py
HTTP/1.1 plaintext 221,895 198,383 174,524 173,432 149,429 69,151 23,658 17,875
HTTP/1.1 JSON 212,397 199,204 165,961 174,877 141,451 69,099 24,107 17,945
HTTP/1.1 echo 203,196 187,261 117,795 156,288 132,743 54,794 21,800 16,452
HTTP/2 plaintext 631,952 600,864 227,497 230,920 183,435 25,224 19,359 15,019
HTTP/2 JSON 682,322 675,213 227,955 208,248 177,135 25,180 20,071 14,930
HTTP/2 echo 499,220 568,380 175,608 98,616 158,285 22,964 26,285 13,232

4. Protocol Comparison: HTTP/1.1 and HTTP/2 (h2c)

Runtime HTTP/1.1 peak HTTP/1.1 mean HTTP/2 peak HTTP/2 mean HTTP/2 / HTTP/1.1 (mean)
Rust (rs) 223,686 212,496 684,533 604,498 2.84x
Zuri http.serve() (zuri-serve) 200,921 194,950 703,482 614,819 3.15x
Node.js (node) 175,312 152,760 233,848 210,353 1.38x
Go (go) 181,134 168,199 233,854 179,261 1.07x
Zuri listen() (zuri) 152,870 141,208 184,472 172,952 1.22x
Ruby (rb) 69,659 64,348 25,303 24,456 0.38x
PyPy (pypy) 26,398 23,188 26,474 21,905 0.94x
CPython (py) 18,981 17,424 15,198 14,394 0.83x

Peak Throughput by Protocol

Protocol Peak Throughput

Average Throughput by Protocol

Protocol Average Throughput


5. Workloads: Plaintext, JSON and Echo

Runtime Plaintext peak Plaintext mean JSON peak JSON mean Echo peak Echo mean
Rust (rs) 684,533 426,924 683,149 447,360 532,507 351,208
Zuri http.serve() (zuri-serve) 672,043 399,624 703,482 437,208 625,035 377,821
Node.js (node) 233,183 201,011 233,848 196,958 186,727 146,701
Go (go) 233,854 202,176 210,418 191,562 170,184 127,452
Zuri listen() (zuri) 184,472 166,432 177,539 159,293 160,886 145,514
Ruby (rb) 69,659 47,188 69,269 47,140 55,230 38,879
PyPy (pypy) 25,055 21,509 26,398 22,089 26,474 24,042
CPython (py) 18,307 16,447 18,981 16,438 16,793 14,842

Peak Throughput by Workload

Workloads Peak Throughput

Average Throughput by Workload

Workloads Average Throughput


6. Zuri http.serve() Against listen()

http.serve() runs the same server code as listen(), in one worker isolate per core. Each worker builds its own routes and holds its own connections.

Case zuri zuri-serve Speedup zuri CPU per run (s) zuri-serve CPU per run (s)
HTTP/1.1 plaintext 149,429 198,383 1.33x 0.67 2.24
HTTP/1.1 JSON 141,451 199,204 1.41x 0.70 2.23
HTTP/1.1 echo 132,743 187,261 1.41x 0.75 2.34
HTTP/2 plaintext 183,435 600,864 3.28x 0.55 0.96
HTTP/2 JSON 177,135 675,213 3.81x 0.57 1.08
HTTP/2 echo 158,285 568,380 3.59x 0.64 1.14

Over HTTP/1.1, h2load keeps one request in flight on each connection, 25 in all, and the three multi-core servers all average between 168,000 and 213,000 req/s. Over HTTP/2, 10 streams per connection allow 250 requests in flight.

http.serve() Speedup


7. Latency and Memory

Mean Request Latency (Lower Is Better)

Runtime HTTP/1.1 (ms) HTTP/2 (ms) Overall (ms)
Rust (rs) 0.12 0.28 0.20
Zuri http.serve() (zuri-serve) 0.13 0.33 0.23
Node.js (node) 0.16 1.15 0.65
Zuri listen() (zuri) 0.17 1.39 0.78
Go (go) 0.15 1.48 0.82
Ruby (rb) 0.39 10.19 5.29
PyPy (pypy) 1.09 11.62 6.35
CPython (py) 1.44 17.41 9.43

Latency is h2load's mean time per request. It's higher over HTTP/2 because each connection has up to 10 requests in flight.

Latency Comparison

Memory (Lower Is Better)

Runtime Memory (MB) CPU per run (s)
Rust (rs) 9.7 1.05
Go (go) 46.6 3.47
CPython (py) 54.0 6.33
Zuri listen() (zuri) 152.5 0.65
Ruby (rb) 159.8 2.82
PyPy (pypy) 162.4 4.38
Node.js (node) 215.8 0.60
Zuri http.serve() (zuri-serve) 780.5 1.66

zuri-serve holds the most memory because isolates don't share a heap, so each of its 10 workers has its own. Ruby's figure includes both Falcon's supervising process and its worker.

Memory Footprint


Running It

$ zuri run run.zu out=results/main.jsonl reps=3 requests=100000 concurrency=25 load_limit=1.5
$ zuri run aggregate.zu
$ zuri run generate_charts.zu
$ zuri run summarize.zu

libs=, protocols= and workloads= take comma-separated lists to run part of the suite, and warmup=0 measures each server just after it has started. The charts are written to results/charts.

About

HTTP Benchmark Suite & Report: HTTP/1.1 & HTTP/2 Performance

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages