chunkloris: actix-web (h2c)

part of the chunkloris per-chunk amplification survey. this page is the per-server record for actix-web (h2c) under http/2 (h2c) data frames.

at a glance

  • server: actix-web (h2c) 4.x
  • runtime: rustc 1.89
  • ecosystem: rust
  • concurrency model: event-loop
  • parser: actix-http h2
  • delivery granularity: per-frame
  • 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.86 (wall time vs N, log-log slope across common cells)
  • scaling exponent (mode b): 0.99

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-h2-bridge50,0000.20116.40.660server-cpu-cgroupβœ“
A-h2-bridge100,0000.35515.40.549server-cpu-cgroupβœ“
A-h2-bridge250,0000.80414.10.454server-cpu-cgroupβœ“
B-h2-paced-100us50,0005.4684.65.027server-cpu-cgroupβœ“
B-h2-paced-100us100,00010.8304.14.428server-cpu-cgroupβœ“
B-h2-paced-100us250,00027.0663.84.143server-cpu-cgroupβœ“

parser path β€” source citations

  • Actix HTTP/2 support β€” ? β†’ source
  • Actix h2c binding β€” ? β†’ source

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

  • if this is an h2 origin, prefer a frontend that terminates h2 into h1 with proxy_request_buffering on upstream.
  • consider imposing a per-stream DATA-frame credit (count, not bytes) before forwarding the body to the application handler.
  • HTTP/2 byte-level flow control (WINDOW_UPDATE) does not bound the number of frames; configure stream-frame-rate limits where the implementation exposes them.

reproducer

the full reproducer for this server is in the paper repo. the docker container pins actix-web (h2c) 4.x 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