Skip to content

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

Meta Engineering 10 min read Case study mediumAdept

Asynchronous computing at Meta: Overview and learnings

Meta re-architected Async tier, its serverless asynchronous computing platform running multi-trillion workloads per day, by splitting an overloaded Dispatcher into data-source-specific "tailers" and a source-agnostic scheduler. Tailers now push work to the scheduler over RPC instead of the scheduler pulling from the FOQS queue. This removed redundant copying into FOQS, improved end-to-end latency and cross-region load balancing, and made streams, warehouses and pub/sub first-class sources, at the cost of being a poor fit for long-running workloads. Queues offer lease-based granular retries and flexible ordering at moderate cost, while streams are cheaper for high-volume sequential access but clog on failed items. A separate controlled-delay service, backed by a priority queue or chained fixed-delay streams, preserves at-least-once delivery without blocking the stream.

Assumes: message queuesstream processing basicsat-least-once delivery

Related posts

  • 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.

  • 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.

  • Bringing serverless functions closer to the speed of wire

    Modal mediumAdept

    Modal rebuilt its serverless I/O plane, which queues Function inputs and outputs, and now runs it in at least four regions. A new `routing_region` flag lets callers avoid round trips to us-east, and the completed migration cut end-to-end Function Call latency by about 80ms at p50. The redesign moves non-critical work like autoscaling stats and dashboard events to the background and minimizes shared-storage access on the hot path, using client-side metadata caching and JWT-based auth. It also rewrites the server layer from async Python to Go to avoid event-loop lag, and stays on Redis 7.1 for its Redis-streams queues after load tests showed CPU spikes from 7.2 onward. Users are advised to route near their clients, keep payloads under 2MiB to skip blob-storage uploads, and batch small inputs.

  • Your agents don't care that you're a batch shop

    ClickHouse easyNovice

    Agent workloads turn one business question into tens of sequential, bursty queries, so even batch-oriented firms querying yesterday's data need engines that minimize compute-seconds per query. Using queueing arithmetic (throughput ≈ cores divided by core-seconds held), a desk of 50 agents running 200,000 queries a day needs 667 compute-hours at 12 s per query versus 22 hours at 0.4 s, a 30-fold gap that credit-metered and autoscaling warehouses turn into budget overruns. The recommended engine properties are columnar reads, data skipping, vectorized execution, incremental aggregates, workload isolation and per-role limits, with the lake kept as the system of record. Teams should trace agent and infrastructure spans with OpenTelemetry, count queries per agent task, and compare hold time rather than latency alone.

The quest for software engineering knowledge.

Look:
Layout: