Skip to content

zio-http: the seven profiles it was missing - #1250

Open
MDA2AV wants to merge 2 commits into
mainfrom
feat/zio-http-missing-profiles
Open

zio-http: the seven profiles it was missing#1250
MDA2AV wants to merge 2 commits into
mainfrom
feat/zio-http-missing-profiles

Conversation

@MDA2AV

@MDA2AV MDA2AV commented Aug 21, 2026

Copy link
Copy Markdown
Owner

static, static-tls, json-tls, async-db, crud, api-4 and api-16.
Tests go from 6 to 13.

The entry carried four endpoints — /pipeline, /baseline11, /json/:count,
/upload. api-4 and api-16 rotate over /baseline11, /json and
/async-db, so wiring Postgres brings all three profiles with it.

json-tls / static-tls

A second Server.serve over the same routes on 8081, raced against the plaintext
one. Neither ever completes, so the race only settles if one fails, which takes
the process down rather than leaving a port silently unserved.

Postgres

JDBC through HikariCP. The driver blocks, so every query runs on ZIO's blocking
pool and the server's event loops stay free. DATABASE_URL arrives as
postgres://user:pass@host:port/db, which JDBC does not accept, so it is
rewritten to a jdbc:postgresql:// URL with the credentials lifted out.

static

Bodies are read from disk on every request, per the arena rule that applies in
every mode; only the content type is decided from the name, and the
pre-compressed .br/.gz sibling is picked per request.

crud

Cache-aside on Redis through jedis, 200ms TTL, explicit delete on update.

Note for the next person

java.lang.Runtime has to be spelled out in this file — import zio.* puts
zio.Runtime in scope and shadows it, and the error message sends you toward an
izumi reflection import rather than the actual problem.

Validation

58 passed, 0 failed, including every new profile:

static      20 files verified, 20 compressed / 0 skipped, 404 path
static-tls  20 files verified, 20 compressed / 0 skipped, 404 path
json-tls    protocol negotiation, response schema, Content-Type
async-db    4 limits verified, Content-Type, empty range
crud        list, read, cache-aside MISS->HIT, 404, POST 201, PUT + invalidate

fortunes is deliberately not included.

🤖 Generated with Claude Code

static, static-tls, json-tls, async-db, crud, api-4 and api-16. The entry carried
four endpoints; api-4 and api-16 rotate over /baseline11, /json and /async-db, so
wiring Postgres brings all three profiles with it.

json-tls and static-tls are a second Server.serve over the same routes on 8081,
raced against the plaintext one: neither ever completes, so the race only settles
if one fails, which takes the process down rather than leaving a port silently
unserved.

Postgres is reached over JDBC through HikariCP. The driver blocks, so every query
runs on ZIO's blocking pool and the server's event loops stay free. DATABASE_URL
arrives as postgres://user:pass@host:port/db, which JDBC does not accept, so it
is rewritten to a jdbc:postgresql:// URL with the credentials lifted out.

crud runs cache-aside on Redis through jedis, with a 200ms TTL and an explicit
delete on update.

Static file bodies are read from disk on every request; only the content type is
decided from the name.

Note java.lang.Runtime has to be spelled out: `import zio.*` puts zio.Runtime in
scope and shadows it.

Validation: 58 passed, 0 failed.
@MDA2AV

MDA2AV commented Aug 21, 2026

Copy link
Copy Markdown
Owner Author

/benchmark --save

@github-actions

Copy link
Copy Markdown
Contributor

👋 Benchmark request received. A collaborator will review and approve the run.

@github-actions

Copy link
Copy Markdown
Contributor

Benchmark Results

Framework: zio-http | Test: all tests

Test Conn RPS CPU Mem Δ RPS Δ Mem
baseline 512 1,972,342 6532.3% 4.8GiB +5.4% -2.0%
baseline 4096 1,948,611 6482.6% 4.7GiB -1.4% -7.8%
pipelined 512 6,453,110 6062.6% 6.7GiB +1.8% +6.3%
pipelined 4096 6,375,769 5967.9% 6.5GiB -3.1% -1.5%
limited-conn 512 623,008 3299.0% 1.4GiB -1.7% ~0%
limited-conn 4096 649,490 3132.5% 1.4GiB +1.0% ~0%
json 4096 990,153 6498.5% 5.2GiB -1.5% -8.8%
json-comp 512 297,586 6304.2% 3.0GiB -1.6% -41.2%
json-comp 4096 299,073 6214.8% 3.2GiB +0.2% ~0%
json-comp 16384 294,571 5861.0% 3.2GiB -0.8% -8.6%
json-tls 4096 742,631 6325.9% 5.6GiB NEW NEW
upload 32 1,409 3808.8% 6.2GiB -11.1% -42.1%
upload 256 1,765 6199.8% 10.0GiB -1.7% -60.8%
api-4 256 42,972 401.4% 650MiB NEW NEW
api-16 1024 143,778 1575.1% 1.4GiB NEW NEW
static 1024 229,834 5637.3% 5.9GiB NEW NEW
static 4096 221,663 5477.2% 4.6GiB NEW NEW
static 6800 236,912 5836.3% 7.4GiB NEW NEW
static-tls 1024 202,896 5786.5% 4.9GiB NEW NEW
static-tls 4096 182,598 5964.7% 5.6GiB NEW NEW
static-tls 6800 165,739 5964.3% 6.7GiB NEW NEW
async-db 1024 151,984 3674.0% 5.5GiB NEW NEW
crud 4096 42,535 908.9% 3.0GiB NEW NEW
Full log
gcannon v0.5.3
  Target:    localhost:8080/
  Threads:   64
  Conns:     1024 (16/thread)
  Pipeline:  1
  Req/conn:  25
  Templates: 5
  Expected:  200
  Duration:  10s


  Thread Stats   Avg      p50      p90      p99    p99.9
    Latency   6.00ms   1.09ms   17.70ms   59.20ms   123.10ms

  1319287 requests in 10.00s, 1318433 responses
  Throughput: 131.82K req/s
  Bandwidth:  507.77MB/s
  Status codes: 2xx=1318433, 3xx=0, 4xx=0, 5xx=0
  Latency samples: 1318433 / 1318433 responses (100.0%)
  Reconnects: 52237
  Per-template: 262962,263748,264313,264375,263035
  Per-template-ok: 262962,263748,264313,264375,263035
[info] CPU 3932.9% | Mem 5.5GiB

[run 2/3]
gcannon v0.5.3
  Target:    localhost:8080/
  Threads:   64
  Conns:     1024 (16/thread)
  Pipeline:  1
  Req/conn:  25
  Templates: 5
  Expected:  200
  Duration:  10s


  Thread Stats   Avg      p50      p90      p99    p99.9
    Latency   5.75ms   1.01ms   17.70ms   57.50ms   101.50ms

  1511934 requests in 10.00s, 1511395 responses
  Throughput: 151.11K req/s
  Bandwidth:  582.15MB/s
  Status codes: 2xx=1511395, 3xx=0, 4xx=0, 5xx=0
  Latency samples: 1511392 / 1511395 responses (100.0%)
  Reconnects: 60175
  Per-template: 301513,302145,303101,302884,301749
  Per-template-ok: 301513,302145,303101,302884,301749
[info] CPU 3677.0% | Mem 5.5GiB

[run 3/3]
gcannon v0.5.3
  Target:    localhost:8080/
  Threads:   64
  Conns:     1024 (16/thread)
  Pipeline:  1
  Req/conn:  25
  Templates: 5
  Expected:  200
  Duration:  10s


  Thread Stats   Avg      p50      p90      p99    p99.9
    Latency   5.75ms   1.01ms   17.50ms   56.90ms   101.70ms

  1520445 requests in 10.00s, 1519846 responses
  Throughput: 151.95K req/s
  Bandwidth:  585.48MB/s
  Status codes: 2xx=1519846, 3xx=0, 4xx=0, 5xx=0
  Latency samples: 1519840 / 1519846 responses (100.0%)
  Reconnects: 60499
  Per-template: 302862,303885,305046,304655,303392
  Per-template-ok: 302862,303885,305046,304655,303392
[info] CPU 3674.0% | Mem 5.5GiB

=== Best: 151984 req/s (CPU: 3674.0%, Mem: 5.5GiB) ===
[info] input BW: 10.15MB/s (avg template: 70 bytes)
[info] saved results/async-db/1024/zio-http.json
httparena-bench-zio-http
httparena-bench-zio-http

==============================================
=== zio-http / crud / 4096c (tool=gcannon) ===
==============================================
[info] resetting postgres for a clean per-profile baseline
[info] starting postgres sidecar
httparena-postgres
[info] postgres ready (seeded)
[info] waiting for server...
[info] server ready

[run 1/3]
gcannon v0.5.3
  Target:    localhost:8080/
  Threads:   64
  Conns:     4096 (64/thread)
  Pipeline:  1
  Req/conn:  200
  Templates: 20
  Expected:  200
  Duration:  15s


  Thread Stats   Avg      p50      p90      p99    p99.9
    Latency   98.41ms   1.51ms   311.90ms    1.17s    3.33s

  470362 requests in 15.00s, 466667 responses
  Throughput: 31.11K req/s
  Bandwidth:  11.45MB/s
  Status codes: 2xx=466667, 3xx=0, 4xx=0, 5xx=0
  Latency samples: 466667 / 466667 responses (100.0%)
  Latency overflow (>5s): 269
  Reconnects: 523
  Per-template: 39442,42505,20056,20081,20644,20714,20719,20032,20612,20326,19976,20218,20486,20671,19795,20800,37708,30404,15594,15884
  Per-template-ok: 39442,42505,20056,20081,20644,20714,20719,20032,20612,20326,19976,20218,20486,20671,19795,20800,37708,30404,15594,15884
[info] CPU 1241.8% | Mem 2.8GiB

[run 2/3]
gcannon v0.5.3
  Target:    localhost:8080/
  Threads:   64
  Conns:     4096 (64/thread)
  Pipeline:  1
  Req/conn:  200
  Templates: 20
  Expected:  200
  Duration:  15s


  Thread Stats   Avg      p50      p90      p99    p99.9
    Latency   68.51ms   43.90ms   166.40ms   358.60ms    1.70s

  641453 requests in 15.00s, 638029 responses
  Throughput: 42.53K req/s
  Bandwidth:  13.20MB/s
  Status codes: 2xx=638029, 3xx=0, 4xx=0, 5xx=0
  Latency samples: 638028 / 638029 responses (100.0%)
  Latency overflow (>5s): 314
  Reconnects: 1585
  Per-template: 60941,53799,23446,22442,23643,24362,23517,22964,23638,24185,23789,23491,22175,24139,23430,22599,32655,59970,58494,44349
  Per-template-ok: 60941,53799,23446,22442,23643,24362,23517,22964,23638,24185,23789,23491,22175,24139,23430,22599,32655,59970,58494,44349
[info] CPU 908.9% | Mem 3.0GiB

[run 3/3]
gcannon v0.5.3
  Target:    localhost:8080/
  Threads:   64
  Conns:     4096 (64/thread)
  Pipeline:  1
  Req/conn:  200
  Templates: 20
  Expected:  200
  Duration:  15s


  Thread Stats   Avg      p50      p90      p99    p99.9
    Latency   73.98ms   47.20ms   181.00ms   387.90ms    1.78s

  630441 requests in 15.00s, 627004 responses
  Throughput: 41.79K req/s
  Bandwidth:  13.17MB/s
  Status codes: 2xx=627004, 3xx=0, 4xx=0, 5xx=0
  Latency samples: 627001 / 627004 responses (100.0%)
  Latency overflow (>5s): 334
  Reconnects: 1297
  Per-template: 56945,51255,22889,23901,23421,22550,23134,23214,23561,23417,23968,23225,23926,23570,23348,23553,33802,62285,53818,41219
  Per-template-ok: 56945,51255,22889,23901,23421,22550,23134,23214,23561,23417,23968,23225,23926,23570,23348,23553,33802,62285,53818,41219
[info] CPU 947.2% | Mem 3.0GiB

=== Best: 42535 req/s (CPU: 908.9%, Mem: 3.0GiB) ===
[info] input BW: 3.65MB/s (avg template: 90 bytes)
[info] saved results/crud/4096/zio-http.json
httparena-bench-zio-http
httparena-bench-zio-http
[info] skip: zio-http does not subscribe to fortunes
[info] skip: zio-http does not subscribe to baseline-h2
[info] skip: zio-http does not subscribe to static-h2
[info] skip: zio-http does not subscribe to baseline-h2c
[info] skip: zio-http does not subscribe to json-h2c
[info] skip: zio-http does not subscribe to baseline-h3
[info] skip: zio-http does not subscribe to static-h3
[info] skip: zio-http does not subscribe to gateway-64
[info] skip: zio-http does not subscribe to gateway-h3
[info] skip: zio-http does not subscribe to production-stack
[info] skip: zio-http does not subscribe to unary-grpc
[info] skip: zio-http does not subscribe to unary-grpc-tls
[info] skip: zio-http does not subscribe to stream-grpc
[info] skip: zio-http does not subscribe to stream-grpc-tls
[info] skip: zio-http does not subscribe to echo-ws
[info] skip: zio-http does not subscribe to echo-ws-pipeline
[info] skip: zio-http does not subscribe to echo-ws-limited
[info] rebuilding site/data/*.json
[purged stale] zix-grpc.json (zix-grpc)
[purged stale] zix-ws.json (zix-ws)
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/frameworks.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/results/zio-http.json - 23 new, 23 total
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/current.json
[info] done
httparena-postgres
httparena-redis
[info] restoring loopback MTU to 65536

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant