chunkloris: ws (node)

part of the chunkloris per-chunk amplification survey. this page is the per-server record for ws (Node) under websocket text frames.

at a glance

  • server: ws (Node) ws 8.18.0 on node 22-slim
  • runtime: node-22
  • ecosystem: node
  • concurrency model: event-loop
  • parser: ws/lib/receiver.js (JS state machine; per-message event)
  • 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.70 (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.024β€”0.490wallβœ“
A-ws-bridge100,0000.032β€”0.320wallβœ“
A-ws-bridge250,0000.058β€”0.230wallβœ“
B-ws-paced-100us50,0005.407β€”8.150server-cpu-overheadβœ“
B-ws-paced-100us100,00010.491β€”4.910server-cpu-overheadβœ“
B-ws-paced-100us250,00026.266β€”5.060server-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 ws (Node) ws 8.18.0 on node 22-slim 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