Enhancing Distributed System Load Shedding with TCP Congestion Control Algorithm
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.
Related posts
- Worker Backpressure (Part 1)
Canva Engineering mediumAdeptCanva added Worker Backpressure to its shared queue library: each worker records success/failure outcomes, a pluggable controller maintains a backoff factor (0.0 to 1.0) against a failure-rate set point, and the factor scales down how many messages the worker may poll and process concurrently. Everything runs locally with no coordinator, at a cost of two arithmetic operations per cycle. In a 4-hour multi-spike cloud outage the DLQ grew by one message. In a 32.5-hour quota overload, 1.8M failed attempts produced only 22 DLQ messages, against an estimated 16,000+ without backpressure. The tradeoffs are reduced throughput for saturated workers and reliance on a single success/failure signal, with latency and in-flight signals planned as future additions.
- Asynchronous computing at Meta: Overview and learnings
Meta Engineering mediumAdeptMeta 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.
- From Event-Driven Chaos to a Blazingly Fast Serving API
Zalando Engineering mediumAdeptZalando 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.
- Thundering herd of circuit breakers
Zalando Engineering mediumAdeptA client's circuit breaker stayed open for hours because its half-open probes hit a service that the HPA had scaled down to three pods. The sparse probes succeeded, the breaker closed, and the withheld traffic arrived at once, queued for over 100 ms per request, timed out and re-opened the breaker. Each cycle lasted only about three seconds, too short for CPU-averaged autoscaling to notice. Zalando found the cycle by exporting OpenTelemetry traces as CSV into a bespoke uPlot visualizer that plots hundreds of traces at once. Suggested fixes are autoscaling on queue depth or concurrency, longer or heavier half-open probes, pre-scaling before the breaker closes, load shedding, and propagating cancellations.
- Network Entitlement: A contract-based network sharing solution
Meta Engineering hardMasterMeta's backbone network treats bandwidth as a finite, reservable resource: each service gets a contracted bandwidth quota per region and class of service, with an SLO guarantee covering only traffic within that quota. End hosts mark packets by QoS class and re-mark excess (nonconforming) traffic into a lower-priority queue. That excess still flows when capacity exists and is dropped only under congestion, which isolates misbehaving services and makes it clear whether the network or the service is accountable. Contracts use the hose model so services don't have to forecast per-DC-pair traffic matrices. A granting system simulates failures such as fiber cuts to set quotas for high-touch services, and production congestion drills verify the policy.