Guide
Operations
Operations
Supervision
whiplash.start builds an OTP supervision tree, one for one: a listener, the
acceptors, and a temporary child per connection (and per QUIC connection). A
failed acceptor restarts alone; a failed listener restarts on the same port,
even one first chosen by the system, while established connections keep
serving; a connection that fails takes nothing with it. whiplash.stop
shuts the tree down, connections included.
Whiplash listens on 127.0.0.1 unless told otherwise, so a development server is never reachable from other machines by accident. To serve them, give an address; TLS and HTTP/3 listen on the same one:
let settings = whiplash.options(8080).with_address("0.0.0.0")
"::" listens on every interface, IPv6 included. An address that is not one
("localhost", say) makes start return an error before anything opens.
Memory
Measured from a probe node beside a running server:
- an idle HTTP/1 keep-alive connection: about 35 KiB, most of it the 32 KiB buffer each socket reads into. Idle HTTP/1 and HTTP/2 connections and WebSocket conversations over HTTP/1 hibernate after two quiet seconds;
- an HTTP/2 stream at 400 concurrent 1 MiB streams: about 165 KiB;
- a client that stops reading a stream: about 256 KiB held for it;
- after every load, memory and process counts return to their baseline.
Conformance
| Suite | Result |
|---|---|
| h2spec 2.6.0 | 146/146, strict 147/147 |
| h3spec 0.1.15 | 86 examples, 0 failures |
| Autobahn TestSuite | 517 cases over HTTP/1 and HTTP/2: 0 failed |
| llhttp strict suites | 110 request and 62 response cases, differences documented |
| hpack-test-case | every story |
| aioquic | HTTP/3 requests, streams, uploads, WebSockets, limits; key update, migration, loss, Retry, QPACK dynamic table, 0-RTT |
Performance
Against ewe@9, the fastest of the BEAM servers in the ewe benchmark, on a shared macOS desktop, all fifteen workloads over HTTP/1.1 and HTTP/2, three interleaved repeats:
- HTTP/1.1: greetings and request bodies 1.04 to 1.24 times ewe@9's rate, files 1.05 to 2.9, streams and server-sent events 0.94 to 4.6;
- HTTP/2: request bodies 0.98 to 1.17, files 0.92 to 5.3, small streams and events 1.45 to 1.58; greetings, large streams and large events 0.81 to 0.9.
At fixed request rates (zrk, which avoids coordinated omission), both servers handle 120,000 to 145,000 small requests a second before they fall behind, within a few percent of each other.
These are measurements on one busy desktop, where runs move by 10 to 20%. No performance lead is claimed until the comparison is repeated on an isolated Linux host.