chunkloris: gorilla/websocket

published: May 22, 2026 β€’

part of the chunkloris per-chunk amplification survey. this page is the per-server record for gorilla/websocket under websocket text frames.

at a glance

  • server: gorilla/websocket v1.5.3 on go 1.23
  • runtime: go-1.23
  • ecosystem: go
  • concurrency model: n-m-scheduler
  • parser: gorilla NextReader (hand-rolled; per-frame goroutine yield)
  • delivery granularity: per-recv-batched
  • chunk-limit helper: none exposed by the framework
  • verdict: batches correctly β€” the implementation coalesces wire units before waking the application, either via an explicit per-stream frame credit, a pipelined reader, or a similar batching primitive. mode b cpu cost is in the band you would expect from a per-recv() batched delivery.
  • scaling exponent (mode a): 0.90 (wall time vs N, log-log slope across common cells)

measurements

all cells run on a 1-vcpu docker container. cpu cost is derived from the target container’s cgroup v2 cpu.stat usage_usec delta around each cell.

modeNwall (s)server cpu %Β΅s / framebasisok
A-ws-bridge50,0000.007β€”0.130wallβœ“
A-ws-bridge100,0000.029β€”0.280wallβœ“
A-ws-bridge250,0000.060β€”0.240wallβœ“
B-ws-paced-100us50,0005.244β€”4.890server-cpu-overheadβœ“
B-ws-paced-100us100,00010.514β€”5.140server-cpu-overheadβœ“
B-ws-paced-100us250,00026.397β€”5.590server-cpu-overheadβœ“

what this means

the implementation batches wire units before waking the application (either via an explicit per-stream frame credit, a pipelined reader, or an equivalent primitive). the cpu cost under paced mode b is in the band you would expect from a per-recv() batched delivery.

what to do today

  • this implementation already batches; the cpu cost in mode b is in the per-recv() band.

reproducer

the full reproducer for this server is in the paper repo. the docker container pins gorilla/websocket v1.5.3 on go 1.23 and constrains the test container to a single cpu (--cpus=1). the prober script implements mode a (bridge-coalesced) and mode b (paced 100 Β΅s) per the methodology section.

see the draft pdf for the full per-framework discussion.

on this page