chunkloris: tokio-tungstenite

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.

modeNwall (s)server cpu %Β΅s / framebasisok
A-ws-bridge50,0000.006β€”0.120wallβœ“
A-ws-bridge100,0000.008β€”0.080wallβœ“
A-ws-bridge250,0000.024β€”0.090wallβœ“
B-ws-paced-100us50,0005.252β€”5.040server-cpu-overheadβœ“
B-ws-paced-100us100,00010.647β€”6.470server-cpu-overheadβœ“
B-ws-paced-100us250,00026.780β€”7.120server-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.

on this page