---
title: "Cutting Threads’ send latency in half"
description: "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."
url: "https://swe.quest/articles/cutting-threads-send-latency-in-half-8bdebcb999eebcc4"
canonical: "https://engineering.fb.com/2021/03/22/networking-traffic/cutting-threads-send-latency-in-half/"
source: "Meta Engineering"
published: "2021-03-22"
difficulty: "medium"
kind: "Case study"
reading_minutes: 4
tags: ["performance","caching","load-balancing","distributed-systems"]
---

# Cutting Threads’ send latency in half

A post on [Meta Engineering](https://swe.quest/sources/meta.md), published 2021-03-22, 4 min read, Case study. Original: [https://engineering.fb.com/2021/03/22/networking-traffic/cutting-threads-send-latency-in-half/](https://engineering.fb.com/2021/03/22/networking-traffic/cutting-threads-send-latency-in-half/)

## Summary

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.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Performance engineering](https://swe.quest/tags/performance.md) (Reliability & operations)
- [Caching](https://swe.quest/tags/caching.md) (Backend & APIs)
- [Load balancing](https://swe.quest/tags/load-balancing.md) (Infrastructure)
- [Distributed systems](https://swe.quest/tags/distributed-systems.md) (Distributed systems)

## Prerequisites

- write-through caches
- multi-region data centers
- A/B testing ([easy posts on Testing](https://swe.quest/tags/testing.md?difficulty=easy))

## Keywords

Instagram, Threads

## Related posts

- [How we think about Threads’ iOS performance](https://swe.quest/articles/how-we-think-about-threads-ios-performance-7b6cc96ee6ea9212.md): Meta Engineering · 2024-12-18 · Medium · 15 min read · Mobile, Performance engineering, Observability, Swift, GraphQL
  Threads iOS tracks performance through three headline metrics: %FIRE (frustrating image renders), TTNC (time to fresh network content), and cPSR (creation-publish success rate).
- [Bringing serverless functions closer to the speed of wire](https://swe.quest/articles/bringing-serverless-functions-closer-to-the-speed-of-wire-4593ae513494961f.md): Modal · 2026-08-04 · Medium · 5 min read · Serverless, Performance engineering, System design, Go, Queues & messaging
  Modal rebuilt its serverless I/O plane, which queues Function inputs and outputs, and now runs it in at least four regions.
- [From Event-Driven Chaos to a Blazingly Fast Serving API](https://swe.quest/articles/from-event-driven-chaos-to-a-blazingly-fast-serving-api-515d5b06058dbe2a.md): Zalando Engineering · 2025-03-06 · Medium · 8 min read · Caching, Load balancing, Event-driven architecture, Performance engineering, E-commerce
  Zalando replaced an event-driven pipeline that merged Product, Price and Stock events with a central Product Read API (PRAPI).
- [Incident Report: October 16th, 2025](https://swe.quest/articles/incident-report-october-16th-2025-6eb111a489b39aef.md): Railway · 2025-10-16 · Easy · 3 min read · Incidents & postmortems, Load balancing, Resilience, CDN & edge
  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.
- [Making Shopify’s Flagship App 20% Faster in 6 Weeks Using a Novel Caching Solution](https://swe.quest/articles/making-shopify-s-flagship-app-20-faster-in-6-weeks-using-a-novel-caching-100f1c4cb3fa31e6.md): Shopify Engineering · 2021-09-22 · Medium · 8 min read · Caching, Ruby, Scaling, Deployment, Performance engineering
  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.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
