Skip to content

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

Booking.com Engineering 7 min read Case study mediumAdept

How We Built Automated Capacity Testing for Kafka Consumers

Booking.com extended its HTTP capacity-testing platform to Kafka consumers by using partition assignment as the load knob: a custom priority-aware partition assignor shifts extra partitions onto one target instance step by step, reproducing failure-induced load concentration without killing healthy consumers. A Kafka capacity API translates the scheduler's abstract load ratio into concrete assignments, and a composite health check (liveness, CPU/memory headroom, consumer lag percentile, throughput and errors) decides when to stop and record the last healthy step. Scale commands carry a TTL lease so assignments revert automatically if the controller dies. Load steps are discrete at roughly 1/P of the topic, so effective ratios should be reported. Tests must also be serialized per consumer group because rebalances are group-wide, and the results make N-1 resilience policies testable and support right-sizing.

Assumes: Kafka consumer groupspartition rebalancingconsumer lag

Related posts

  • Building Self-driving Kafka clusters using open source components

    Slack Engineering mediumAdept

    Slack standardized roughly 10 Kafka clusters (0.7 PB, 6.5 Gbps peak) onto Kafka 2.0.1 and automated their operation with Chef, Terraform ASGs, Consul-assigned Zookeeper IDs, Cruise Control, Kafka Manager and a Prometheus offset exporter. Hot spots were removed by making partition counts a multiple of broker count, balancing consumers, throttling replication bandwidth and moving partitions in small batches. Chaos testing with dark traffic showed recovery was limited by packets per second, which jumbo frames helped address. It also motivated a dedicated Zookeeper per Kafka cluster and a cut-over upgrade policy instead of in-place upgrades. Splitting the largest topics off a saturated 90-broker cluster onto d3en instances gave about 2.5x efficiency, cut worst-case log latency from about 1.5 hours to 3-4 minutes, and reduced monthly alerts from 71 to 9.

  • Achieving relentless Kafka reliability at scale with the Streaming Platform

    Datadog Engineering mediumAdept

    Datadog runs hundreds of Kafka clusters with millions of partitions and built the Streaming Platform, a control layer that decouples producers and consumers from specific clusters through "Streams" spanning clusters, AZs and Kubernetes environments. A custom coordinator, the Assigner, replaces Kafka's timeout-based group coordination with metric-driven, seconds-scale rebalancing and live failovers that create a new topic and drain the old one. Head-of-line blocking is removed with priority lanes, a dead-letter lane for poison pills, and multi-range offset tracking stored in commit metadata, which also carries ingestion timestamps to compute real-time time lag from __consumer_offsets. After zstd decompression bombs crashed consumers, the team built libstreaming, a Rust Kafka client with bindings for other languages, and rejected a gRPC proxy because of throughput and latency costs.

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

  • Viewing the world as a computer: Global capacity management

    Meta Engineering mediumAdept

    Meta manages capacity across its 14 data center regions with two systems built on Twine and RAS. Global Reservations Service lets latency-tolerant services declare one global capacity request; a mixed-integer linear programming solver assigns machines to reservations, enforcing that capacity minus the largest region still meets demand. For example, a 300-server request becomes 150 servers in each of three regions, and the disaster-readiness buffer shrinks as capacity spreads over more regions. Regional Fluidity handles latency-sensitive services by using distributed tracing to attribute traffic to shiftable demand sources, solving a placement plan from dependency and traffic-ratio constraints, and having an Orchestrator sequence safe shifts: add capacity and replicas, move traffic, then reclaim.

  • Worker Backpressure (Part 1)

    Canva Engineering mediumAdept

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

The quest for software engineering knowledge.

Look:
Layout: