P99 0 ms* autocomplete for 240 million domain names

P99 0 ms* autocomplete for 240M domain names

Wirewiki's creator describes how he achieved p99 0 ms autocomplete for 240 million domain names. The trick: prefetch suggestions on keyDown and render on keyUp, giving a ~121 ms budget. The API uses an in-memory trie for popular domains and a memory-mapped block index for the long tail, with most requests answered in under 2 ms. End-to-end latency is network-bound, and while a single European server works for most users, global coverage would require geo-distributed servers.

Even at 1.6k req/s, Nginx + the API responds in 15 ms 99% of the time.

More from this day

2026-08-31