Skip to content

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

Zalando Engineering 28 min read Case study hardMaster

Client-Side Load Balancing at a Million Requests Per Second

Zalando moved the high fan-out internal traffic of its Product Read API (over a million requests per second at peak) off the shared Skipper ingress and onto an in-process client-side load balancer. The balancer reproduces Skipper's xxHash64 consistent-hash ring with 100 virtual nodes so caches stay aligned during migration, and discovers pods through a watch-based Kubernetes EndpointSlice informer with a 2-second debounce. Rollout ran behind percentage toggles with a transparent Skipper fallback. It flattened latency spikes and shrank Skipper's fleet from over 50 pods to 8, cutting daily node cost from about $450 to $110. Owning the balancer also enabled N-ring fade-in, which warms new pods with exactly the keys they will keep, and bounded load driven by per-pod occupancy (seconds of work per second) rather than in-flight counts. The work was made possible by first cutting median deploy time from 289 to 128 minutes.

Related posts

  • Scaling Beyond Limits: Harnessing Route Server for a Stable Cluster

    Zalando Engineering mediumAdept

    Zalando put a Route Server between its Skipper ingress proxies and the Kubernetes API after roughly 180 Skipper instances per cluster, each polling Ingresses and RouteGroups, overloaded etcd and throttled the API server. Route Server polls the API every 3 seconds, converts resources into an Eskip routing table and serves it with an ETag, so unchanged tables return HTTP 304. If Route Server is down, Skipper keeps its last known routes and an alert fires. Rollout used disabled, pre-processing (shadow, with route-table diffs) and execution modes, tier by tier, with zero downtime. Skipper's autoscaling ceiling rose to 300 pods, and one Route Server deployment handles about 100 RPS.

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

  • Node.js at scale, rebalanced: how we cut cost by 38%

    Booking.com Engineering mediumAdept

    Booking.com cut compute costs for its largest Node.js React SSR service by 38% (30% fewer pods, 20% less memory per pod, up to 10% lower tail latency) without touching service code, by moving from pm2's cluster-based processes to wattpm worker threads and revisiting long-untouched configuration. Synthetic k6 tests showed 20-50% more throughput within latency SLOs, validated through a side-by-side production A/B split at the routing layer. Production exposed uneven worker load because SO_REUSEPORT's connection hashing interacted badly with nginx loopback connections recycled via tcp_tw_reuse. Giving each worker its own port and load-balancing in nginx fixed it, which also opened the door to smarter balancing between heavy renders and light metadata requests.

  • Leveraging Go Worker Pools to Scale Server-side Data Sharing

    Shopify Engineering mediumAdept

    Shopify's Server Pixels service, a Go pipeline that consumes over a billion customer events per day from Kafka, fell behind on consumer lag because it spawned an unbounded number of goroutines to process and produce event batches. Replacing that with a fixed-size worker pool fed by a jobs channel, built on a reusable Worker interface and shut down gracefully with context cancellation and WaitGroups, bounded resource use. Throughput per pod rose from 7.75k to 12.9k events/sec with 15 workers, 19.3k with 50, and 21k after further tuning, a 170% gain. That headroom carried the service through a 46k events/sec peak during BFCM 2021.

  • Migrating Millions of Concurrent Websockets to Envoy

    Slack Engineering mediumAdept

    Slack moved its websocket ingress tier, serving millions of concurrent connections, from HAProxy to Envoy Proxy. HAProxy reloads spawned long-lived draining processes that had to be reaped and rate-limited. Envoy's dynamic clusters, hot restarts and panic routing removed that operational overhead. Envoy config was generated through custom Chef resources with --mode validate checks, and traffic shifted region by region via NS1 weighted DNS in 10–100% steps on a parallel stack, completing in six months with no customer impact. Key lessons: the organically grown HAProxy config hid behaviours services depended on, a test suite for load balancer routing would have saved effort, and limiting Chef libraries to a subset of Envoy features kept them simple but made later additions like vhosts awkward.

The quest for software engineering knowledge.

Look:
Layout: