Skip to content

zix http1 entry#998

Open
prothegee wants to merge 52 commits into
MDA2AV:mainfrom
prothegee:zix-http1
Open

zix http1 entry#998
prothegee wants to merge 52 commits into
MDA2AV:mainfrom
prothegee:zix-http1

Conversation

@prothegee

@prothegee prothegee commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Description

zix entry for http1 using 0.5.x-rc2 branch.

Update:

  • Using dual listener port.
  • Tweak on config init side.
  • Adding database tests entries.

Checklist:

  • /benchmark -f zix
  • /benchmark -f zix --save

@prothegee

Copy link
Copy Markdown
Contributor Author

Testing new approach and database tests entries for H1.

@prothegee

Copy link
Copy Markdown
Contributor Author

/benchmark -f zix

@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: zix | Test: all tests

Test Conn RPS CPU Mem Δ RPS Δ Mem
baseline 512 4,271,672 6433.6% 541MiB +1.3% +316.2%
baseline 4096 4,421,593 6274.1% 565MiB -1.6% +203.8%
pipelined 512 53,759,494 6441.7% 540MiB +0.3% +303.0%
pipelined 4096 55,456,780 6287.7% 563MiB -0.9% +202.7%
limited-conn 512 2,692,208 5435.0% 545MiB -1.8% +263.3%
limited-conn 4096 2,713,743 5613.0% 576MiB -1.4% +143.0%
json 4096 2,367,341 5563.2% 563MiB +0.8% +94.1%
json-comp 512 2,229,405 5245.1% 551MiB NEW NEW
json-comp 4096 3,081,536 6299.5% 572MiB NEW NEW
json-comp 16384 2,897,019 6390.4% 627MiB NEW NEW
json-tls 4096 1,924,633 4725.9% 691MiB NEW NEW
upload 32 8,202 1042.1% 533MiB +0.2% +329.8%
upload 256 6,667 930.5% 535MiB ~0% +311.5%
api-4 256 67,827 260.7% 96MiB NEW NEW
api-16 1024 249,618 1418.6% 330MiB NEW NEW
static 1024 2,035,434 5566.0% 546MiB +0.5% +290.0%
static 4096 2,020,569 5441.5% 589MiB -0.8% +202.1%
static 6800 1,995,731 5432.8% 625MiB +0.5% +159.3%
async-db 1024 161,571 5287.1% 778MiB NEW NEW
crud 4096 397,237 6125.3% 911MiB NEW NEW
Full log

  1615711 requests in 10.00s, 1615714 responses
  Throughput: 161.53K req/s
  Bandwidth:  622.15MB/s
  Status codes: 2xx=1615714, 3xx=0, 4xx=0, 5xx=0
  Latency samples: 1615713 / 1615714 responses (100.0%)
  Reconnects: 64447
  Per-template: 322384,323182,324038,323664,322445
  Per-template-ok: 322384,323182,324038,323664,322445
[info] CPU 5287.1% | Mem 778MiB

[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.87ms   4.02ms   13.30ms   26.40ms   40.20ms

  1597296 requests in 10.00s, 1597296 responses
  Throughput: 159.69K req/s
  Bandwidth:  615.35MB/s
  Status codes: 2xx=1597296, 3xx=0, 4xx=0, 5xx=0
  Latency samples: 1597288 / 1597296 responses (100.0%)
  Reconnects: 63687
  Per-template: 318534,319412,320003,320251,319088
  Per-template-ok: 318534,319412,320003,320251,319088
[info] CPU 5310.1% | Mem 778MiB

[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.98ms   4.05ms   13.60ms   27.70ms   42.50ms

  1576268 requests in 10.00s, 1576269 responses
  Throughput: 157.59K req/s
  Bandwidth:  607.15MB/s
  Status codes: 2xx=1576269, 3xx=0, 4xx=0, 5xx=0
  Latency samples: 1576268 / 1576269 responses (100.0%)
  Reconnects: 62916
  Per-template: 314270,315364,315921,316093,314620
  Per-template-ok: 314270,315364,315921,316093,314620
[info] CPU 5283.3% | Mem 780MiB

=== Best: 161571 req/s (CPU: 5287.1%, Mem: 778MiB) ===
[info] input BW: 10.79MB/s (avg template: 70 bytes)
[info] saved results/async-db/1024/zix.json
httparena-bench-zix
httparena-bench-zix

==============================================
=== zix / 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   9.55ms   4.58ms   26.30ms   53.60ms   82.50ms

  5914586 requests in 15.00s, 5914458 responses
  Throughput: 394.23K req/s
  Bandwidth:  117.30MB/s
  Status codes: 2xx=5914458, 3xx=0, 4xx=0, 5xx=0
  Latency samples: 5914458 / 5914458 responses (100.0%)
  Reconnects: 27558
  Per-template: 276171,225981,237739,245494,247002,252165,260374,272274,298253,322818,332488,336119,334368,335294,337649,335812,346286,332210,292270,293691
  Per-template-ok: 276171,225981,237739,245494,247002,252165,260374,272274,298253,322818,332488,336119,334368,335294,337649,335812,346286,332210,292270,293691
[info] CPU 6079.2% | Mem 836MiB

[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   10.29ms   5.50ms   27.60ms   55.70ms   81.50ms

  5523342 requests in 15.00s, 5523342 responses
  Throughput: 368.15K req/s
  Bandwidth:  108.67MB/s
  Status codes: 2xx=5523342, 3xx=0, 4xx=0, 5xx=0
  Latency samples: 5523342 / 5523342 responses (100.0%)
  Reconnects: 25697
  Per-template: 283340,225371,200793,213489,215258,220841,233345,263351,292941,305974,307911,305734,307094,310358,310255,310865,320324,317244,290729,288125
  Per-template-ok: 283340,225371,200793,213489,215258,220841,233345,263351,292941,305974,307911,305734,307094,310358,310255,310865,320324,317244,290729,288125
[info] CPU 6153.5% | Mem 867MiB

[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   9.47ms   3.37ms   27.40ms   55.40ms   80.70ms

  5958566 requests in 15.00s, 5958566 responses
  Throughput: 397.13K req/s
  Bandwidth:  117.90MB/s
  Status codes: 2xx=5958566, 3xx=0, 4xx=0, 5xx=0
  Latency samples: 5958549 / 5958566 responses (100.0%)
  Reconnects: 27904
  Per-template: 283593,242813,239440,229595,232262,234667,243260,267479,299094,327889,338869,341645,340298,341922,343987,342990,350179,320409,322060,316098
  Per-template-ok: 283593,242813,239440,229595,232262,234667,243260,267479,299094,327889,338869,341645,340298,341922,343987,342990,350179,320409,322060,316098
[info] CPU 6125.3% | Mem 911MiB

=== Best: 397237 req/s (CPU: 6125.3%, Mem: 911MiB) ===
[info] input BW: 34.10MB/s (avg template: 90 bytes)
[info] saved results/crud/4096/zix.json
httparena-bench-zix
httparena-bench-zix
[info] skip: zix does not subscribe to fortunes
[info] skip: zix does not subscribe to baseline-h2
[info] skip: zix does not subscribe to static-h2
[info] skip: zix does not subscribe to baseline-h2c
[info] skip: zix does not subscribe to json-h2c
[info] skip: zix does not subscribe to baseline-h3
[info] skip: zix does not subscribe to static-h3
[info] skip: zix does not subscribe to gateway-64
[info] skip: zix does not subscribe to gateway-h3
[info] skip: zix does not subscribe to production-stack
[info] skip: zix does not subscribe to unary-grpc
[info] skip: zix does not subscribe to unary-grpc-tls
[info] skip: zix does not subscribe to stream-grpc
[info] skip: zix does not subscribe to stream-grpc-tls
[info] skip: zix does not subscribe to echo-ws
[info] skip: zix does not subscribe to echo-ws-pipeline
[info] rebuilding site/data/*.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/frameworks.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/api-16-1024.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/api-4-256.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/async-db-1024.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/baseline-4096.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/baseline-512.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/crud-4096.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/json-4096.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/json-comp-16384.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/json-comp-4096.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/json-comp-512.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/json-tls-4096.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/limited-conn-4096.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/limited-conn-512.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/pipelined-4096.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/pipelined-512.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/static-1024.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/static-4096.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/static-6800.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/upload-256.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/upload-32.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/current.json
[info] done
httparena-postgres
httparena-redis
[info] restoring loopback MTU to 65536

@prothegee

Copy link
Copy Markdown
Contributor Author

Oh my, didn't expect the cpu burn that much with high memory consumption.

@prothegee
prothegee marked this pull request as draft July 15, 2026 20:09
@prothegee
prothegee marked this pull request as ready for review July 21, 2026 02:43
prothegee added 16 commits July 23, 2026 07:12
edited:
- replay caches dropped, gzip runs per request
- header reserve sized from the largest render
edited:
- ITEM_TTL_MS 5000 -> 200 per the crud profile

removed:
- list-page slots, ttl refresh, list body cap
added:
- one pipelined lane per worker via dispatch
  Line and the engine fd watch
- WritePool for deferred client writes

edited:
- SCAN_CAP_PER_CONN 4 -> 8
- list total = page size, no count(*) OVER()

removed:
- shard threads and fd routing
edited:
- db endpoints open lanes lazily per worker

removed:
- cache and dbrd imports and startup
- response_cache config
@prothegee

Copy link
Copy Markdown
Contributor Author

Fixed has been made.
Testing normal bench before assign --save run.

@prothegee

Copy link
Copy Markdown
Contributor Author

/benchmark -f zix

@github-actions

Copy link
Copy Markdown
Contributor

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

@prothegee

Copy link
Copy Markdown
Contributor Author

Below the adjustment/reworked as follows:

json / json-comp / json-tls:

Requested: serialize (and compress) per request, remove the response cache from the /json path.

Change (frameworks/zix/src/handlers/json.zig, frameworks/zix/src/main.zig):

  • The replay path is gone: no response lookup, no stored responses, no TTL.
  • Every request renders the JSON body from the loaded dataset, assembles the
    header, and writes it out per request.
  • gzip responses compress per request from the freshly rendered body.
  • The engine response-cache configuration is removed from main.zig (nothing
    uses it anymore), so there is no response cache anywhere on the entry.

upload:

Requested: count the bytes actually read off the socket and return that count.

Change (frameworks/zix/src/handlers/upload.zig plus the vendored zix engine):

  • The engine's receive path now counts every byte it consumes off the socket
    for a body larger than the receive buffer, completes the body before the
    handler runs, and exposes the counted total as Request.bodyReceived().
  • The handler returns that counted total. The Content-Length header value is
    no longer used for the response.

crud:

Requested: single-item read TTL 200 ms, drop the list-response cache.

Change (frameworks/zix/src/shared/crudcache.zig, frameworks/zix/src/handlers/crud.zig, frameworks/zix/src/shared/dbpg.zig):

  • Single-item TTL is 200 ms absolute (writes still invalidate the id on PUT,
    cache-aside with X-Cache: MISS / X-Cache: HIT unchanged).
  • The list-page cache is removed entirely (slots, lookups, stores, and both
    call sites), so GET /crud/items executes the live
    SELECT ... LIMIT ... OFFSET on every request.

@github-actions

Copy link
Copy Markdown
Contributor

Benchmark Results

Framework: zix | Test: all tests

Test Conn RPS CPU Mem Δ RPS Δ Mem
baseline 512 4,094,778 6336.1% 132MiB -2.9% +1.5%
baseline 4096 4,458,742 6411.3% 190MiB -0.8% +2.2%
pipelined 512 53,636,038 6387.4% 126MiB ~0% -6.0%
pipelined 4096 57,722,794 6423.4% 185MiB +3.1% -0.5%
limited-conn 512 2,646,780 5623.6% 123MiB -3.4% -18.0%
limited-conn 4096 2,709,337 5984.8% 230MiB -1.5% -3.0%
json 4096 2,407,076 6073.7% 243MiB +2.5% -16.2%
json-comp 512 1,032,259 6210.3% 118MiB NEW NEW
json-comp 4096 1,143,836 6817.7% 205MiB NEW NEW
json-comp 16384 1,118,087 6754.9% 520MiB NEW NEW
json-tls 4096 1,925,586 5007.6% 273MiB NEW NEW
upload 32 8,893 1022.5% 124MiB +8.6% ~0%
upload 256 6,436 879.9% 126MiB -3.4% -3.1%
api-4 256 68,006 210.9% 41MiB NEW NEW
api-16 1024 250,744 1066.4% 120MiB NEW NEW
static 1024 2,015,185 5570.4% 138MiB -0.5% -1.4%
static 4096 2,007,155 5586.0% 207MiB -1.4% +6.2%
static 6800 1,987,466 5456.7% 266MiB ~0% +10.4%
async-db 1024 404,766 3207.2% 322MiB NEW NEW
crud 4096 837,664 3313.2% 394MiB NEW NEW
Full log

  4047659 requests in 10.00s, 4047662 responses
  Throughput: 404.68K req/s
  Bandwidth:  1.52GB/s
  Status codes: 2xx=4047662, 3xx=0, 4xx=0, 5xx=0
  Latency samples: 4047662 / 4047662 responses (100.0%)
  Reconnects: 161424
  Per-template: 806693,809480,812120,811832,807537
  Per-template-ok: 806693,809480,812120,811832,807537
[info] CPU 3207.2% | Mem 322MiB

[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   2.09ms    704us   5.07ms   19.90ms   35.70ms

  3765543 requests in 10.00s, 3765540 responses
  Throughput: 376.48K req/s
  Bandwidth:  1.42GB/s
  Status codes: 2xx=3765540, 3xx=0, 4xx=0, 5xx=0
  Latency samples: 3765533 / 3765540 responses (100.0%)
  Reconnects: 150634
  Per-template: 750955,752930,755392,754939,751317
  Per-template-ok: 750955,752930,755392,754939,751317
[info] CPU 3130.0% | Mem 319MiB

[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   2.15ms    717us   5.13ms   20.90ms   44.60ms

  3719885 requests in 10.00s, 3719886 responses
  Throughput: 371.91K req/s
  Bandwidth:  1.40GB/s
  Status codes: 2xx=3719886, 3xx=0, 4xx=0, 5xx=0
  Latency samples: 3719876 / 3719886 responses (100.0%)
  Reconnects: 148806
  Per-template: 741354,744011,746212,745875,742424
  Per-template-ok: 741354,744011,746212,745875,742424
[info] CPU 3111.7% | Mem 319MiB

=== Best: 404766 req/s (CPU: 3207.2%, Mem: 322MiB) ===
[info] input BW: 27.02MB/s (avg template: 70 bytes)
[info] saved results/async-db/1024/zix.json
httparena-bench-zix
httparena-bench-zix

==============================================
=== zix / 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   5.23ms   1.72ms   14.70ms   23.10ms   34.90ms

  11083054 requests in 15.00s, 11082607 responses
  Throughput: 738.71K req/s
  Bandwidth:  217.65MB/s
  Status codes: 2xx=11082607, 3xx=0, 4xx=0, 5xx=0
  Latency samples: 11082607 / 11082607 responses (100.0%)
  Reconnects: 53352
  Per-template: 546940,524740,538990,547750,548499,539037,527230,516812,508187,506425,514741,524744,540426,562658,584322,605811,620317,625450,613064,586464
  Per-template-ok: 546940,524740,538990,547750,548499,539037,527230,516812,508187,506425,514741,524744,540426,562658,584322,605811,620317,625450,613064,586464
[info] CPU 2994.1% | Mem 401MiB

[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   4.69ms   1.50ms   13.50ms   23.30ms   30.70ms

  12154474 requests in 15.00s, 12154474 responses
  Throughput: 810.17K req/s
  Bandwidth:  237.04MB/s
  Status codes: 2xx=12154474, 3xx=0, 4xx=0, 5xx=0
  Latency samples: 12154455 / 12154474 responses (100.0%)
  Reconnects: 58929
  Per-template: 575799,560255,574039,586342,595827,600125,603372,599748,598467,595110,594883,596445,605038,616612,631352,650980,658139,655578,639403,616941
  Per-template-ok: 575799,560255,574039,586342,595827,600125,603372,599748,598467,595110,594883,596445,605038,616612,631352,650980,658139,655578,639403,616941
[info] CPU 3178.0% | Mem 396MiB

[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   4.60ms   1.60ms   13.30ms   23.10ms   30.00ms

  12564966 requests in 15.00s, 12564968 responses
  Throughput: 837.53K req/s
  Bandwidth:  245.12MB/s
  Status codes: 2xx=12564968, 3xx=0, 4xx=0, 5xx=0
  Latency samples: 12564940 / 12564968 responses (100.0%)
  Reconnects: 60948
  Per-template: 591834,573389,589720,605521,614937,620953,623023,623262,619353,616117,614404,618840,627082,641111,656859,677158,680413,674674,661202,635088
  Per-template-ok: 591834,573389,589720,605521,614937,620953,623023,623262,619353,616117,614404,618840,627082,641111,656859,677158,680413,674674,661202,635088
[info] CPU 3313.2% | Mem 394MiB

=== Best: 837664 req/s (CPU: 3313.2%, Mem: 394MiB) ===
[info] input BW: 71.90MB/s (avg template: 90 bytes)
[info] saved results/crud/4096/zix.json
httparena-bench-zix
httparena-bench-zix
[info] skip: zix does not subscribe to fortunes
[info] skip: zix does not subscribe to baseline-h2
[info] skip: zix does not subscribe to static-h2
[info] skip: zix does not subscribe to baseline-h2c
[info] skip: zix does not subscribe to json-h2c
[info] skip: zix does not subscribe to baseline-h3
[info] skip: zix does not subscribe to static-h3
[info] skip: zix does not subscribe to gateway-64
[info] skip: zix does not subscribe to gateway-h3
[info] skip: zix does not subscribe to production-stack
[info] skip: zix does not subscribe to unary-grpc
[info] skip: zix does not subscribe to unary-grpc-tls
[info] skip: zix does not subscribe to stream-grpc
[info] skip: zix does not subscribe to stream-grpc-tls
[info] skip: zix does not subscribe to echo-ws
[info] skip: zix does not subscribe to echo-ws-pipeline
[info] rebuilding site/data/*.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/frameworks.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/api-16-1024.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/api-4-256.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/async-db-1024.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/baseline-4096.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/baseline-512.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/crud-4096.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/json-4096.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/json-comp-16384.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/json-comp-4096.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/json-comp-512.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/json-tls-4096.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/limited-conn-4096.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/limited-conn-512.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/pipelined-4096.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/pipelined-512.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/static-1024.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/static-4096.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/static-6800.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/upload-256.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/upload-32.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/current.json
[info] done
httparena-postgres
httparena-redis
[info] restoring loopback MTU to 65536

@prothegee

Copy link
Copy Markdown
Contributor Author

/benchmark -f zix --save

@github-actions

Copy link
Copy Markdown
Contributor

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

@prothegee

Copy link
Copy Markdown
Contributor Author

Below the adjustment/reworked as follows:

json / json-comp / json-tls:

Requested: serialize (and compress) per request, remove the response cache from the /json path.

Change (frameworks/zix/src/handlers/json.zig, frameworks/zix/src/main.zig):

* The replay path is gone: no response lookup, no stored responses, no TTL.

* Every request renders the JSON body from the loaded dataset, assembles the
  header, and writes it out per request.

* gzip responses compress per request from the freshly rendered body.

* The engine response-cache configuration is removed from `main.zig` (nothing
  uses it anymore), so there is no response cache anywhere on the entry.

upload:

Requested: count the bytes actually read off the socket and return that count.

Change (frameworks/zix/src/handlers/upload.zig plus the vendored zix engine):

* The engine's receive path now counts every byte it consumes off the socket
  for a body larger than the receive buffer, completes the body before the
  handler runs, and exposes the counted total as `Request.bodyReceived()`.

* The handler returns that counted total. The `Content-Length` header value is
  no longer used for the response.

crud:

Requested: single-item read TTL 200 ms, drop the list-response cache.

Change (frameworks/zix/src/shared/crudcache.zig, frameworks/zix/src/handlers/crud.zig, frameworks/zix/src/shared/dbpg.zig):

* Single-item TTL is 200 ms absolute (writes still invalidate the id on PUT,
  cache-aside with `X-Cache: MISS` / `X-Cache: HIT` unchanged).

* The list-page cache is removed entirely (slots, lookups, stores, and both
  call sites), so `GET /crud/items` executes the live
  `SELECT ... LIMIT ... OFFSET` on every request.

Requesting review before --save and merge @MDA2AV

@github-actions

Copy link
Copy Markdown
Contributor

Benchmark Results

Framework: zix | Test: all tests

Test Conn RPS CPU Mem Δ RPS Δ Mem
baseline 512 4,067,485 6443.9% 127MiB -3.6% -2.3%
baseline 4096 4,455,412 6415.3% 188MiB -0.8% +1.1%
pipelined 512 53,352,112 6435.5% 124MiB -0.5% -7.5%
pipelined 4096 57,643,456 6223.0% 188MiB +3.0% +1.1%
limited-conn 512 2,640,088 5615.1% 122MiB -3.7% -18.7%
limited-conn 4096 2,703,646 5845.0% 231MiB -1.7% -2.5%
json 4096 2,420,229 6110.8% 244MiB +3.0% -15.9%
json-comp 512 1,028,610 6112.8% 123MiB NEW NEW
json-comp 4096 1,139,164 6839.4% 206MiB NEW NEW
json-comp 16384 1,110,719 6827.6% 522MiB NEW NEW
json-tls 4096 1,938,324 4996.3% 273MiB NEW NEW
upload 32 8,872 1039.4% 124MiB +8.4% ~0%
upload 256 6,460 891.1% 126MiB -3.0% -3.1%
api-4 256 69,172 227.1% 41MiB NEW NEW
api-16 1024 249,200 969.6% 120MiB NEW NEW
static 1024 2,026,656 5612.5% 141MiB ~0% +0.7%
static 4096 2,026,878 5598.9% 205MiB -0.5% +5.1%
static 6800 1,988,793 5367.8% 273MiB +0.1% +13.3%
async-db 1024 407,196 3235.6% 325MiB NEW NEW
crud 4096 837,446 3310.6% 395MiB NEW NEW
Full log

  4071965 requests in 10.00s, 4071966 responses
  Throughput: 407.11K req/s
  Bandwidth:  1.53GB/s
  Status codes: 2xx=4071966, 3xx=0, 4xx=0, 5xx=0
  Latency samples: 4071962 / 4071966 responses (100.0%)
  Reconnects: 162419
  Per-template: 811429,814276,816822,816811,812624
  Per-template-ok: 811429,814276,816822,816811,812624
[info] CPU 3235.6% | Mem 325MiB

[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   2.08ms    692us   4.67ms   21.50ms   50.00ms

  3772931 requests in 10.00s, 3772930 responses
  Throughput: 377.20K req/s
  Bandwidth:  1.42GB/s
  Status codes: 2xx=3772930, 3xx=0, 4xx=0, 5xx=0
  Latency samples: 3772921 / 3772930 responses (100.0%)
  Reconnects: 150914
  Per-template: 751953,754270,756841,756803,753054
  Per-template-ok: 751953,754270,756841,756803,753054
[info] CPU 3147.3% | Mem 321MiB

[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   2.16ms    689us   5.05ms   21.90ms   45.30ms

  3729008 requests in 10.00s, 3729014 responses
  Throughput: 372.82K req/s
  Bandwidth:  1.40GB/s
  Status codes: 2xx=3729014, 3xx=0, 4xx=0, 5xx=0
  Latency samples: 3729004 / 3729014 responses (100.0%)
  Reconnects: 149128
  Per-template: 743766,745439,747345,747674,744780
  Per-template-ok: 743766,745439,747345,747674,744780
[info] CPU 3126.2% | Mem 319MiB

=== Best: 407196 req/s (CPU: 3235.6%, Mem: 325MiB) ===
[info] input BW: 27.18MB/s (avg template: 70 bytes)
[info] saved results/async-db/1024/zix.json
httparena-bench-zix
httparena-bench-zix

==============================================
=== zix / 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   5.23ms   1.61ms   14.80ms   23.50ms   34.80ms

  11082572 requests in 15.00s, 11081230 responses
  Throughput: 738.63K req/s
  Bandwidth:  217.72MB/s
  Status codes: 2xx=11081230, 3xx=0, 4xx=0, 5xx=0
  Latency samples: 11081230 / 11081230 responses (100.0%)
  Reconnects: 53375
  Per-template: 548375,527879,539612,543705,543367,538400,524202,509886,504585,507146,516086,529681,546070,565458,585245,606284,621683,624704,611758,587104
  Per-template-ok: 548375,527879,539612,543705,543367,538400,524202,509886,504585,507146,516086,529681,546070,565458,585245,606284,621683,624704,611758,587104
[info] CPU 2999.1% | Mem 402MiB

[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   4.79ms   1.85ms   13.60ms   23.10ms   31.40ms

  12041558 requests in 15.00s, 12041789 responses
  Throughput: 802.66K req/s
  Bandwidth:  235.94MB/s
  Status codes: 2xx=12041789, 3xx=0, 4xx=0, 5xx=0
  Latency samples: 12041536 / 12041789 responses (100.0%)
  Reconnects: 58242
  Per-template: 574978,554696,570097,582662,590869,591236,588940,584179,579467,578767,580606,584441,597564,614677,634714,655356,665186,658931,638510,615660
  Per-template-ok: 574978,554696,570097,582662,590869,591236,588940,584179,579467,578767,580606,584441,597564,614677,634714,655356,665186,658931,638510,615660
[info] CPU 3165.9% | Mem 397MiB

[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   4.56ms   1.43ms   13.20ms   22.50ms   29.40ms

  12561703 requests in 15.00s, 12561702 responses
  Throughput: 837.31K req/s
  Bandwidth:  244.20MB/s
  Status codes: 2xx=12561702, 3xx=0, 4xx=0, 5xx=0
  Latency samples: 12561663 / 12561702 responses (100.0%)
  Reconnects: 60974
  Per-template: 596624,579712,597201,611824,622188,627091,628935,626288,621374,620256,619929,618770,622523,633313,646516,664900,670682,664773,655041,633723
  Per-template-ok: 596624,579712,597201,611824,622188,627091,628935,626288,621374,620256,619929,618770,622523,633313,646516,664900,670682,664773,655041,633723
[info] CPU 3310.6% | Mem 395MiB

=== Best: 837446 req/s (CPU: 3310.6%, Mem: 395MiB) ===
[info] input BW: 71.88MB/s (avg template: 90 bytes)
[info] saved results/crud/4096/zix.json
httparena-bench-zix
httparena-bench-zix
[info] skip: zix does not subscribe to fortunes
[info] skip: zix does not subscribe to baseline-h2
[info] skip: zix does not subscribe to static-h2
[info] skip: zix does not subscribe to baseline-h2c
[info] skip: zix does not subscribe to json-h2c
[info] skip: zix does not subscribe to baseline-h3
[info] skip: zix does not subscribe to static-h3
[info] skip: zix does not subscribe to gateway-64
[info] skip: zix does not subscribe to gateway-h3
[info] skip: zix does not subscribe to production-stack
[info] skip: zix does not subscribe to unary-grpc
[info] skip: zix does not subscribe to unary-grpc-tls
[info] skip: zix does not subscribe to stream-grpc
[info] skip: zix does not subscribe to stream-grpc-tls
[info] skip: zix does not subscribe to echo-ws
[info] skip: zix does not subscribe to echo-ws-pipeline
[info] rebuilding site/data/*.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/frameworks.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/api-16-1024.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/api-4-256.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/async-db-1024.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/baseline-4096.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/baseline-512.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/crud-4096.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/json-4096.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/json-comp-16384.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/json-comp-4096.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/json-comp-512.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/json-tls-4096.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/limited-conn-4096.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/limited-conn-512.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/pipelined-4096.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/pipelined-512.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/static-1024.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/static-4096.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/static-6800.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/upload-256.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/upload-32.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/current.json
[info] done
httparena-postgres
httparena-redis
[info] restoring loopback MTU to 65536

MDA2AV and others added 2 commits July 24, 2026 23:32
This branch saved results before MDA2AV#1034, so it carries 20
site/data/<profile>-<conns>.json files that main has since replaced with one
file per framework; git reported them all as modify/delete conflicts.

Every row this PR added or changed against its merge base was re-applied to
site/data/results/zix.json and the flat files dropped - 8 profiles this entry
did not publish before (api-4, api-16, async-db, crud, json-comp at three
connection counts, json-tls) and 12 it updated (baseline, limited-conn,
pipelined, json, static, upload). Two keys already in main were left alone,
because this PR did not touch them.
@prothegee

Copy link
Copy Markdown
Contributor Author

/benchmark -f zix --save

@github-actions

Copy link
Copy Markdown
Contributor

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

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.

2 participants