Skip to content

uio-ws: update to uio v1.8.0 - #1677

Open
limpo1989 wants to merge 4 commits into
MDA2AV:mainfrom
limpo1989:main
Open

limpo1989 wants to merge 4 commits into
MDA2AV:mainfrom
limpo1989:main

Conversation

@limpo1989

Copy link
Copy Markdown
Contributor

Description

Updates the uio-ws entry from uio v1.5.4 to the v1.8.0 release.

  • uws.Options API: the server is built with uws.NewServer(uws.Options{...});
    pollers stay at one per CPU.
  • SO_REUSEPORT listener group: one listening socket per poller, so a WebSocket
    upgrade is accepted on the event loop that runs its connection instead of
    crossing loops — the path echo-ws-limited exercises.
  • Text echo through Message.Text(), a no-copy string view of the payload.
  • Dependency changes that follow the release: segmentio/asm (SIMD UTF-8
    validation) added.

PR Commands — comment on this PR to trigger (requires collaborator approval):

Command Description
/benchmark -f <framework> Run every test the framework subscribes to
/benchmark -f <framework> -t <test> Run one test only
/benchmark -f <framework> --save Run and save results (updates the leaderboard on merge)
/benchmark -f <framework> -t <test> --save Run one test and save results
/benchmark -f <framework> --compare <other> Measure the deltas against another framework instead of this one
/benchmark-multiple -f <fw1>,<fw2>,... Benchmark several frameworks in one run — takes -t and --save too; saved results land in a single commit
/benchmark-multiple --save No -f needed: benchmark and save every framework the PR touches
/benchmark-test -t <test> Benchmark all enabled frameworks subscribed to <test> and save the results

For /benchmark, always specify -f <framework>; the flags combine in any order. Results come back as a comment with a per-profile table of RPS, p99, CPU and memory — one table per framework on multi runs. A new benchmark comment while a run is in flight queues behind it (one deep) instead of cancelling it. For multi-framework PRs (dependency bumps, same-language refactors) prefer /benchmark-multiple, which runs everything in a single job and commits all saved results together, so no run overwrites another. --compare works on single-framework runs only.

What the deltas are measured against. By default, this framework's own results published on main - answering "did this change help?". When you are tuning a variant or a successor entry, --compare re-bases them on another entry instead:

/benchmark -f genhttp --compare genhttp-kestrel

The reply states which baseline it used, and profiles the other framework does not run show n/a rather than a delta.


Run benchmarks locally

You can validate and benchmark your framework locally with the lite script — no CPU pinning, fixed connection counts, all load generators run in Docker.

./scripts/validate.sh <framework>
./scripts/benchmark-lite.sh <framework> baseline
./scripts/benchmark-lite.sh --load-threads 4 <framework>

Requirements: Docker Engine on Linux. Load generators (gcannon, h2load, h2load-h3, wrk) are built as self-contained Docker images on first run.

@MDA2AV

MDA2AV commented Oct 29, 2026

Copy link
Copy Markdown
Owner

/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: uio-ws | Test: all tests

Test Conn RPS CPU Mem Δ RPS Δ Mem
echo-ws 512 3,536,314 6305.1% 49MiB -2.8% ~0%
echo-ws 4096 3,825,244 6541.6% 77MiB +10.8% -4.9%
echo-ws 16384 3,547,352 6047.7% 150MiB +7.9% -11.2%
echo-ws-pipeline 512 51,087,980 6302.5% 44MiB +3.9% -10.2%
echo-ws-pipeline 4096 55,398,451 6348.3% 76MiB +19.1% -6.2%
echo-ws-pipeline 16384 51,874,586 6502.5% 161MiB +15.9% -4.7%
echo-ws-limited 512 1,483,041 4830.6% 71MiB +44.2% +7.6%
echo-ws-limited 4096 1,645,850 4499.2% 103MiB +61.0% +60.9%

Composite score, main against this run, in the board's default view:

Family main this run Δ
WebSocket 1986.3 (#11 of 14) 2346.8 (#8 of 14) +360.5

The results on main were measured in another session, so a few points up or down can be the machine and not the change.

Full log
  WS frames:   259372930
  Latency samples: 259372930 / 259372930 responses (100.0%)
[info] CPU 6502.5% | Mem 161MiB

[run 3/3]
gcannon v0.5.3 [WS]
  Target:    localhost:8080/ws
  Threads:   64
  Conns:     16384 (256/thread)
  Pipeline:  16
  Req/conn:  unlimited (keep-alive)
  Expected:  200
  Duration:  5s


  Thread Stats   Avg      p50      p90      p99    p99.9
    Latency   4.98ms   5.47ms   7.26ms   11.50ms   15.20ms

  259436130 frames sent in 5.00s, 259173986 frames received
  Throughput: 51.82M req/s
  Bandwidth:  346.33MB/s
  WS upgrades: 16384
  WS frames:   259173986
  Latency samples: 259173986 / 259173986 responses (100.0%)
[info] CPU 6174.1% | Mem 165MiB

=== Best: 51874586 req/s (CPU: 6502.5%, Mem: 161MiB) ===
[info] saved results/echo-ws-pipeline/16384/uio-ws.json
httparena-bench-uio-ws
httparena-bench-uio-ws

==============================================
=== uio-ws / echo-ws-limited / 512c (tool=gcannon) ===
==============================================
[info] ws-only framework — skipping HTTP probe (sleep 2s for startup)

[run 1/3]
gcannon v0.5.3 [WS]
  Target:    localhost:8080/ws
  Threads:   64
  Conns:     512 (8/thread)
  Pipeline:  1
  Req/conn:  10
  Expected:  200
  Duration:  5s


  Thread Stats   Avg      p50      p90      p99    p99.9
    Latency    209us    130us    376us   1.40ms   3.13ms

  7240475 frames sent in 5.00s, 7240426 frames received
  Throughput: 1.45M req/s
  Bandwidth:  27.48MB/s
  WS upgrades: 728779
  WS frames:   7240426
  Latency samples: 7240407 / 7240426 responses (100.0%)
  Reconnects: 724015
[info] CPU 4694.8% | Mem 70MiB

[run 2/3]
gcannon v0.5.3 [WS]
  Target:    localhost:8080/ws
  Threads:   64
  Conns:     512 (8/thread)
  Pipeline:  1
  Req/conn:  10
  Expected:  200
  Duration:  5s


  Thread Stats   Avg      p50      p90      p99    p99.9
    Latency    209us    130us    369us   1.35ms   3.08ms

  7309723 frames sent in 5.00s, 7309719 frames received
  Throughput: 1.46M req/s
  Bandwidth:  27.74MB/s
  WS upgrades: 742600
  WS frames:   7309719
  Latency samples: 7309693 / 7309719 responses (100.0%)
  Reconnects: 730960
[info] CPU 4878.7% | Mem 69MiB

[run 3/3]
gcannon v0.5.3 [WS]
  Target:    localhost:8080/ws
  Threads:   64
  Conns:     512 (8/thread)
  Pipeline:  1
  Req/conn:  10
  Expected:  200
  Duration:  5s


  Thread Stats   Avg      p50      p90      p99    p99.9
    Latency    211us    132us    378us   1.35ms   3.12ms

  7415135 frames sent in 5.00s, 7415209 frames received
  Throughput: 1.48M req/s
  Bandwidth:  28.14MB/s
  WS upgrades: 754861
  WS frames:   7415209
  Latency samples: 7415176 / 7415209 responses (100.0%)
  Reconnects: 741527
[info] CPU 4830.6% | Mem 71MiB

=== Best: 1483041 req/s (CPU: 4830.6%, Mem: 71MiB) ===
[info] saved results/echo-ws-limited/512/uio-ws.json
httparena-bench-uio-ws
httparena-bench-uio-ws

==============================================
=== uio-ws / echo-ws-limited / 4096c (tool=gcannon) ===
==============================================
[info] ws-only framework — skipping HTTP probe (sleep 2s for startup)

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


  Thread Stats   Avg      p50      p90      p99    p99.9
    Latency    829us    277us   1.52ms   5.28ms   70.40ms

  7489715 frames sent in 5.00s, 7486731 frames received
  Throughput: 1.50M req/s
  Bandwidth:  28.46MB/s
  WS upgrades: 751881
  WS frames:   7486731
  Latency samples: 7486731 / 7486731 responses (100.0%)
  Reconnects: 747609
[info] CPU 4294.4% | Mem 91MiB

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


  Thread Stats   Avg      p50      p90      p99    p99.9
    Latency    769us    292us   1.49ms   5.35ms   53.30ms

  7807398 frames sent in 5.00s, 7806699 frames received
  Throughput: 1.56M req/s
  Bandwidth:  29.63MB/s
  WS upgrades: 785172
  WS frames:   7806700
  Latency samples: 7806654 / 7806699 responses (100.0%)
  Reconnects: 780160

  WARNING: 18446744073709551615/7806699 responses (236293778890534.3%) had unexpected status (expected 2xx)
[info] CPU 4504.5% | Mem 81MiB

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


  Thread Stats   Avg      p50      p90      p99    p99.9
    Latency    837us    336us   1.62ms   5.79ms   54.20ms

  8229089 frames sent in 5.00s, 8229251 frames received
  Throughput: 1.65M req/s
  Bandwidth:  31.23MB/s
  WS upgrades: 826666
  WS frames:   8229251
  Latency samples: 8229242 / 8229251 responses (100.0%)
  Reconnects: 822944
[info] CPU 4499.2% | Mem 103MiB

=== Best: 1645850 req/s (CPU: 4499.2%, Mem: 103MiB) ===
[info] saved results/echo-ws-limited/4096/uio-ws.json
httparena-bench-uio-ws
httparena-bench-uio-ws
[info] skip: uio-ws does not subscribe to latency-1m
[info] skip: uio-ws does not subscribe to latency-10k
[info] skip: uio-ws does not subscribe to latency-500k-8cpu
[info] skip: uio-ws does not subscribe to async
[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/results/uio-ws.json - 8 new, 8 total
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/current.json
[info] done
[info] restoring loopback MTU to 65536

- Drop the one-loop-per-CPU override; extra loops only add turn hand-offs.
@limpo1989

Copy link
Copy Markdown
Contributor Author

uio-ws now leaves the poller count at uio's default instead of one per CPU: extra loops
only add the turn hand-offs that short-lived connections pay repeatedly.

@limpo1989

Copy link
Copy Markdown
Contributor Author

/benchmark -f uio-ws --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: uio-ws | Test: all tests

Test Conn RPS CPU Mem Δ RPS Δ Mem
echo-ws 512 3,460,527 6561.1% 47MiB -4.9% -4.1%
echo-ws 4096 3,693,055 6521.8% 73MiB +7.0% -9.9%
echo-ws 16384 3,578,548 6522.0% 156MiB +8.8% -7.7%
echo-ws-pipeline 512 51,867,254 6391.1% 50MiB +5.5% +2.0%
echo-ws-pipeline 4096 54,415,846 6564.5% 73MiB +17.0% -9.9%
echo-ws-pipeline 16384 52,468,675 6191.0% 163MiB +17.3% -3.6%
echo-ws-limited 512 1,869,683 5782.4% 66MiB +81.8% ~0%
echo-ws-limited 4096 2,034,053 5632.3% 100MiB +99.0% +56.2%

Composite score, main against this run, in the board's default view:

Family main this run Δ
WebSocket 1986.3 (#11 of 14) 2495.5 (#8 of 14) +509.2

The results on main were measured in another session, so a few points up or down can be the machine and not the change.

Full log
  Bandwidth:  350.09MB/s
  WS upgrades: 16384
  WS frames:   261995570
  Latency samples: 261995570 / 261995570 responses (100.0%)
[info] CPU 6505.7% | Mem 159MiB

[run 3/3]
gcannon v0.5.3 [WS]
  Target:    localhost:8080/ws
  Threads:   64
  Conns:     16384 (256/thread)
  Pipeline:  16
  Req/conn:  unlimited (keep-alive)
  Expected:  200
  Duration:  5s


  Thread Stats   Avg      p50      p90      p99    p99.9
    Latency   4.87ms   1.55ms   6.29ms   56.90ms   154.70ms

  262601424 frames sent in 5.00s, 262343376 frames received
  Throughput: 52.45M req/s
  Bandwidth:  350.56MB/s
  WS upgrades: 16384
  WS frames:   262343376
  Latency samples: 262343376 / 262343376 responses (100.0%)
[info] CPU 6191.0% | Mem 163MiB

=== Best: 52468675 req/s (CPU: 6191.0%, Mem: 163MiB) ===
[info] saved results/echo-ws-pipeline/16384/uio-ws.json
httparena-bench-uio-ws
httparena-bench-uio-ws

==============================================
=== uio-ws / echo-ws-limited / 512c (tool=gcannon) ===
==============================================
[info] ws-only framework — skipping HTTP probe (sleep 2s for startup)

[run 1/3]
gcannon v0.5.3 [WS]
  Target:    localhost:8080/ws
  Threads:   64
  Conns:     512 (8/thread)
  Pipeline:  1
  Req/conn:  10
  Expected:  200
  Duration:  5s


  Thread Stats   Avg      p50      p90      p99    p99.9
    Latency    177us    143us    303us    772us   2.20ms

  9216925 frames sent in 5.00s, 9217034 frames received
  Throughput: 1.84M req/s
  Bandwidth:  34.98MB/s
  WS upgrades: 927753
  WS frames:   9217034
  Latency samples: 9216991 / 9217034 responses (100.0%)
  Reconnects: 921770
[info] CPU 5522.4% | Mem 65MiB

[run 2/3]
gcannon v0.5.3 [WS]
  Target:    localhost:8080/ws
  Threads:   64
  Conns:     512 (8/thread)
  Pipeline:  1
  Req/conn:  10
  Expected:  200
  Duration:  5s


  Thread Stats   Avg      p50      p90      p99    p99.9
    Latency    181us    147us    309us    776us   2.29ms

  9348360 frames sent in 5.00s, 9348417 frames received
  Throughput: 1.87M req/s
  Bandwidth:  35.47MB/s
  WS upgrades: 951347
  WS frames:   9348417
  Latency samples: 9348375 / 9348417 responses (100.0%)
  Reconnects: 934861
[info] CPU 5782.4% | Mem 66MiB

[run 3/3]
gcannon v0.5.3 [WS]
  Target:    localhost:8080/ws
  Threads:   64
  Conns:     512 (8/thread)
  Pipeline:  1
  Req/conn:  10
  Expected:  200
  Duration:  5s


  Thread Stats   Avg      p50      p90      p99    p99.9
    Latency    181us    147us    309us    772us   2.42ms

  9338142 frames sent in 5.00s, 9338211 frames received
  Throughput: 1.87M req/s
  Bandwidth:  35.44MB/s
  WS upgrades: 947535
  WS frames:   9338211
  Latency samples: 9339533 / 9338211 responses (100.0%)
  Reconnects: 933840
[info] CPU 5674.7% | Mem 66MiB

=== Best: 1869683 req/s (CPU: 5782.4%, Mem: 66MiB) ===
[info] saved results/echo-ws-limited/512/uio-ws.json
httparena-bench-uio-ws
httparena-bench-uio-ws

==============================================
=== uio-ws / echo-ws-limited / 4096c (tool=gcannon) ===
==============================================
[info] ws-only framework — skipping HTTP probe (sleep 2s for startup)

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


  Thread Stats   Avg      p50      p90      p99    p99.9
    Latency   1.35ms    498us   3.13ms   13.20ms   39.70ms

  9904263 frames sent in 5.00s, 9901534 frames received
  Throughput: 1.98M req/s
  Bandwidth:  37.61MB/s
  WS upgrades: 992066
  WS frames:   9901534
  Latency samples: 9901534 / 9901534 responses (100.0%)
  Reconnects: 988875
[info] CPU 5384.7% | Mem 90MiB

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


  Thread Stats   Avg      p50      p90      p99    p99.9
    Latency   1.32ms    497us   3.02ms   11.90ms   38.90ms

  10129650 frames sent in 5.00s, 10128824 frames received
  Throughput: 2.02M req/s
  Bandwidth:  38.43MB/s
  WS upgrades: 1015853
  WS frames:   10128824
  Latency samples: 10128791 / 10128824 responses (100.0%)
  Reconnects: 1012134
[info] CPU 5853.2% | Mem 102MiB

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


  Thread Stats   Avg      p50      p90      p99    p99.9
    Latency   1.33ms    523us   3.09ms   12.00ms   34.20ms

  10170399 frames sent in 5.00s, 10170265 frames received
  Throughput: 2.03M req/s
  Bandwidth:  38.60MB/s
  WS upgrades: 1024457
  WS frames:   10170265
  Latency samples: 10170209 / 10170265 responses (100.0%)
  Reconnects: 1016829
[info] CPU 5632.3% | Mem 100MiB

=== Best: 2034053 req/s (CPU: 5632.3%, Mem: 100MiB) ===
[info] saved results/echo-ws-limited/4096/uio-ws.json
httparena-bench-uio-ws
httparena-bench-uio-ws
[info] skip: uio-ws does not subscribe to latency-1m
[info] skip: uio-ws does not subscribe to latency-10k
[info] skip: uio-ws does not subscribe to latency-500k-8cpu
[info] skip: uio-ws does not subscribe to async
[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/results/uio-ws.json - 8 new, 8 total
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/current.json
[info] done
[info] restoring loopback MTU to 65536

This branch has not been deployed

No deployments
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