Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Jane Street Tech Blog 9 min read Case study mediumAdept

Scaling and benchmarking a critical message bus using a new indexing strategy

Aria, Jane Street's internal message bus, was burning CPU by linearly filtering its in-memory ring buffer whenever lagging clients recovered a subset of topics. An intern added per-topic-partition indexes, merged with an n-way min-heap and stored in a shared pool of 1024-entry blocks so indexes grow and shrink dynamically, which cut CPU by about 30% on real workloads. For on-disk initial recovery, where one restart went from 2.5 seconds to 13 minutes by reading 10x more data than needed, a fixed three-segment subtree split was replaced with adaptive splitting that combines greedy clustering and binary search over per-topic volume. Both changes were validated with agent-driven heap benchmarks, expect tests, property-based tests and Antithesis runs.

Assumes: pub/sub messagingring buffersheaps and n-way merge

Related posts

  • Getting from tested to battle-tested

    Jane Street Tech Blog mediumAdept

    Jane Street's Aria, a low-latency message bus with strong ordering guarantees, already had unit, simulated-network, quickcheck, AFL fuzz, version-skew, lab and chaos tests, yet adding Antithesis's deterministic-hypervisor testing surfaced two unknown bugs on the first run. A worked example traces a crash to a tip-retransmitter that, after restarting from a snapshot and before filling its ring buffer, served NUL bytes instead of an error for requests predating the snapshot. The bug had been masked for local clients by service discovery and was only exposed when cross-region clients started optimistically connecting. The investigation used Antithesis's rewind, branching and in-VM tcpdump to pin down the exact request offset versus snapshot offset.

  • FOQS: Making a distributed priority queue disaster-ready

    Meta Engineering mediumAdept

    Meta's FOQS distributed priority queue moved from isolated regional installations on semi-synchronous replicated MySQL to a single global installation, after Hurricane Florence in 2018 exposed manual traffic rebalancing and items stuck on unreachable shards. The global design uses Shard Manager so a queue node in the new region takes over a MySQL primary within seconds of failover. A routing service maps logical region preferences to shards for enqueue and keeps a heap-based cache of nodes with ready items for dequeue. Migrating the Async platform required parallelizing cache replenishment, which nearly halved its latency, and randomizing selection among top-priority nodes to fix thundering herd and starvation. The 2021 migration finished with zero downtime using shadow load testing, config-based rollouts and health dashboards.

  • Enhancing Distributed System Load Shedding with TCP Congestion Control Algorithm

    Zalando Engineering mediumAdept

    Zalando's customer communication platform applies TCP-style AIMD (Additive Increase Multiplicative Decrease) congestion control at its ingestion point to shed load and prioritize critical messages. The Stream Consumer pulls events from Nakadi and watches RabbitMQ publish latency (P50) and publish errors as congestion signals. Each event type's throttle adjusts its consumption rate independently: higher-priority types increase faster and decrease less (e.g. +15/−20% for P1 vs +5/−60% for P3), so no central coordination is needed. After six months in production, order confirmations keep stable processing times while commercial messages absorb delays. RabbitMQ queues stay small, and backlog remains in Nakadi, where low-priority events can be discarded in an emergency.

  • Index sharding in ClickHouse Cloud: Petabyte-scale data needs petabyte-scale indexing

    ClickHouse hardMaster

    Index sharding in ClickHouse Cloud splits primary and secondary index analysis across replicas using consistent hashing over data parts. Each replica loads and analyzes only its own slice of the index and returns matching granule ranges for the initiator to merge, so total index memory across the fleet stays at the size of the index instead of growing with replica count. If analysis of a part fails on a remote replica, the initiator falls back to analyzing that part locally. On a 50-billion-row table with 10 replicas, index analysis ran 4.3–7.7× faster (bloom filter, vector and full-text indexes gained the most), with a further 1.4–1.7× gain at 20 replicas.

  • How Meta built the infrastructure for Threads

    Meta Engineering mediumAdept

    Threads reached 100 million sign-ups in five days on existing shared Meta infrastructure rather than purpose-built systems, illustrated through two components: ZippyDB and Async. ZippyDB, a multi-tenant key/value store, absorbs sudden demand by shifting unused allocations and slack between keyspaces via config changes. It scales out with a zero-downtime resharding protocol that remaps logical shards to new physical shards, which let the team proactively prepare Threads keyspaces for 100x growth just before launch. Async (XFaaS), a serverless deferred-execution platform, queued the far-higher-than-expected follow-graph imports and notification jobs and rate-limited their execution to protect downstream services such as the social graph database.

The quest for software engineering knowledge.

Look:
Layout: