chunkloris: gorilla/websocket
on this page
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.
| mode | N | wall (s) | server cpu % | Β΅s / frame | basis | ok |
|---|---|---|---|---|---|---|
A-ws-bridge | 50,000 | 0.007 | β | 0.130 | wall | β |
A-ws-bridge | 100,000 | 0.029 | β | 0.280 | wall | β |
A-ws-bridge | 250,000 | 0.060 | β | 0.240 | wall | β |
B-ws-paced-100us | 50,000 | 5.244 | β | 4.890 | server-cpu-overhead | β |
B-ws-paced-100us | 100,000 | 10.514 | β | 5.140 | server-cpu-overhead | β |
B-ws-paced-100us | 250,000 | 26.397 | β | 5.590 | server-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.