Skip to content

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

Meta Engineering 4 min read Case study mediumAdept

Cutting Threads’ send latency in half

Instagram's Threads messaging app cut media send latency in half, partly by fixing a "configure" endpoint that ran four times slower in one region. The endpoint was IO-bound on a read-optimized write-through cache whose backing store lived in another region, so every write paid a cross-region round trip. Routing the whole web request to the region hosting the backing store batched those round trips. A client-side A/B flag, sent as an HTTP header and matched by a routing rule, showed about a 29% send latency improvement.

Assumes: write-through cachesmulti-region data centersA/B testing

Related posts

  • How we think about Threads’ iOS performance

    Meta Engineering mediumAdept

    Threads iOS tracks performance through three headline metrics: %FIRE (frustrating image renders), TTNC (time to fresh network content), and cPSR (creation-publish success rate). A binary-size gate on every commit keeps the app a quarter the size of Instagram, and non-incremental builds run twice as fast. A latency-injection boundary test showed that even fractions of a second of added navigation latency reduced launches, likes and conversation views. That finding led to SLATE, a logger that automatically places latency markers through shared UI components, and SLATE was then used to confirm that GraphQL matched REST on p95 latency before GraphQL was adopted for new endpoints. On publishing, Drafts cut posting-related bug reports by 26%, but a disk-usage bug introduced after its launch then had to be fixed.

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

  • From Event-Driven Chaos to a Blazingly Fast Serving API

    Zalando Engineering mediumAdept

    Zalando replaced an event-driven pipeline that merged Product, Price and Stock events with a central Product Read API (PRAPI). During Cyber Week that pipeline delayed price and stock updates by up to 30 minutes, because over 90% of each payload was unchanged. PRAPI is a Caffeine async-loading cache over DynamoDB, run on Kubernetes with Netty/Epoll non-blocking I/O, and serves millions of requests per second at sub-10ms P99. Consistent hash load balancing in Skipper partitions the catalogue so small per-pod caches hold hot products. Fixed ring positions and a bounded-load cap of 2× the average keep caches warm during scaling and stop hyped products from overloading a pod. Tail latency came down by caching payloads as byte arrays to avoid GC pauses, using LIFO queuing, and splitting DynamoDB clients into a 10ms primary and a 100ms fallback. Adoption across ~350 teams worked because PRAPI served the legacy formats via the Accept header, and the org was restructured along CQRS lines.

  • Incident Report: October 16th, 2025

    Railway easyNovice

    A traffic spike on Railway's Edge Network coincided with a routine edge service upgrade and exhausted memory in an internal routing service that was already running at high utilization. New proxies could not initialize, failed health checks and were pulled by load balancers, causing 2-3 minutes of intermittent HTTP/TCP failures (404s, 522s) across all regions while private networking stayed unaffected. Recovery came as caching absorbed the load. Fixes include higher memory limits, tiered memory alerts and overload safeguards, with a memory-efficient rewrite and a multi-region architecture planned to isolate failures per region.

  • Making Shopify’s Flagship App 20% Faster in 6 Weeks Using a Novel Caching Solution

    Shopify Engineering mediumAdept

    Shop's home feed, which aggregated orders and carrier tracking data and accounted for 30% of database load, was moved behind a custom write-through cache in Memcached, cutting database load by 15%, overall GraphQL latency by about 20% and CPU usage by a double-digit percentage. To handle concurrent order updates without serving stale data, each user has a pending-writes counter that workers increment before a database write and decrement after it. A short-expiry key detects crashed writers so the cache can be safely rewarmed. The logic was mixed into Active Record models as concerns, so the ORM API was unchanged. Correctness was validated in a shadow rollout that compared cache and database reads before serving from the cache.

The quest for software engineering knowledge.

Look:
Layout: