---
title: "How We Built Automated Capacity Testing for Kafka Consumers"
description: "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."
url: "https://swe.quest/articles/how-we-built-automated-capacity-testing-for-kafka-consumers-bca74c5a1d624617"
canonical: "https://medium.com/booking-com-development/how-we-built-automated-capacity-testing-for-kafka-consumers-1853623bce78"
source: "Booking.com Engineering"
published: "2026-09-14"
difficulty: "medium"
kind: "Case study"
reading_minutes: 7
tags: ["messaging","capacity-planning","resilience","testing","sre"]
---

# How We Built Automated Capacity Testing for Kafka Consumers

A post on [Booking.com Engineering](https://swe.quest/sources/booking.md), published 2026-09-14, 7 min read, Case study. Original: [https://medium.com/booking-com-development/how-we-built-automated-capacity-testing-for-kafka-consumers-1853623bce78](https://medium.com/booking-com-development/how-we-built-automated-capacity-testing-for-kafka-consumers-1853623bce78)

## Summary

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.

Written by swe.quest, not by the author.

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

## Topics

- [Queues & messaging](https://swe.quest/tags/messaging.md) (Backend & APIs)
- [Capacity planning](https://swe.quest/tags/capacity-planning.md) (Reliability & operations)
- [Resilience](https://swe.quest/tags/resilience.md) (Distributed systems)
- [Testing](https://swe.quest/tags/testing.md) (Engineering practices)
- [SRE](https://swe.quest/tags/sre.md) (Reliability & operations)

## Prerequisites

- Kafka consumer groups ([easy posts on Queues & messaging](https://swe.quest/tags/messaging.md?difficulty=easy))
- partition rebalancing
- consumer lag

## Keywords

Kafka, partition assignor, N-1 resilience, Booking.com

## Related posts

- [Building Self-driving Kafka clusters using open source components](https://swe.quest/articles/building-self-driving-kafka-clusters-using-open-source-components-f376c07215769703.md): Slack Engineering · 2022-02-11 · Medium · 11 min read · Queues & messaging, Scaling, SRE, Chaos engineering, Infrastructure as code
  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.
- [Achieving relentless Kafka reliability at scale with the Streaming Platform](https://swe.quest/articles/achieving-relentless-kafka-reliability-at-scale-with-the-streaming-platform-ccf96914fd7cb7a9.md): Datadog Engineering · 2025-02-19 · Medium · 10 min read · Queues & messaging, Resilience, Distributed systems, Scaling, Rust
  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.
- [Enhancing Distributed System Load Shedding with TCP Congestion Control Algorithm](https://swe.quest/articles/enhancing-distributed-system-load-shedding-with-tcp-congestion-control-algorithm-c180104e3f071048.md): Zalando Engineering · 2024-04-22 · Medium · 9 min read · Resilience, Event-driven architecture, Queues & messaging, Microservices
  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.
- [Viewing the world as a computer: Global capacity management](https://swe.quest/articles/viewing-the-world-as-a-computer-global-capacity-management-a52a2917bf341403.md): Meta Engineering · 2022-09-06 · Medium · 13 min read · Capacity planning, Datacenters, Scheduling, Distributed systems, Resilience
  Meta manages capacity across its 14 data center regions with two systems built on Twine and RAS.
- [Worker Backpressure (Part 1)](https://swe.quest/articles/worker-backpressure-part-1-6d000eabc0ad7f1d.md): Canva Engineering · 2026-09-17 · Medium · 11 min read · Resilience, Queues & messaging, SRE
  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.

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)
