chunkloris: tokio-tungstenite
on this page
part of the chunkloris per-chunk amplification survey. this page is the per-server record for tokio-tungstenite under websocket text frames.
at a glance
- server: tokio-tungstenite
0.24 on rust 1.83 - runtime: rust-1.83
- ecosystem: rust
- concurrency model: n-m-scheduler
- parser: tungstenite FrameCodec (manual buffered decode)
- 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.80 (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.006 | β | 0.120 | wall | β |
A-ws-bridge | 100,000 | 0.008 | β | 0.080 | wall | β |
A-ws-bridge | 250,000 | 0.024 | β | 0.090 | wall | β |
B-ws-paced-100us | 50,000 | 5.252 | β | 5.040 | server-cpu-overhead | β |
B-ws-paced-100us | 100,000 | 10.647 | β | 6.470 | server-cpu-overhead | β |
B-ws-paced-100us | 250,000 | 26.780 | β | 7.120 | 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 tokio-tungstenite 0.24 on rust 1.83 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.