Skip to main content
One binary, four layers, no plugins. Understanding the shape of the codebase makes the rest of the documentation predictable.

The layers

Where things live

Threads

There is no single shared pool — loop, fs, and ffi each own a separate 4-thread pool. See Concurrency for the full inventory.

Hot-path design

  • SoA connection table — 512 slots stored as parallel arrays with packed 2-byte flags (ConnFlags is a packed struct(u16)), so the hot loop touches cache lines, not objects.
  • Static per-slot buffers — 4 KB request read buffer (spills to the heap up to 1 MB per request, retaining up to 64 KB per slot within a 64 MB global budget) and 64 KB response staging per connection (spills to the heap up to 10 MB, retaining up to 256 KB for reuse).
  • HeadersData refcount — one heap object with an atomic refcount, shared by Request / Response / Headers across thread boundaries.
  • Zero-copy URLs — one allocation per URL; components are pooled slices.
  • Worker messages — one small allocation plus a memcpy per message.
  • Postgres arenas — per-job arena with a 32 KB retain cap plus a job freelist, so a warm query path allocates nothing.

Build options

All four are fetched by ./scripts/fetch-vendors.sh — they are not committed. See Installation.

I/O backends

See also