---
title: "Building Self-driving Kafka clusters using open source components"
description: "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."
url: "https://swe.quest/articles/building-self-driving-kafka-clusters-using-open-source-components-f376c07215769703"
canonical: "https://slack.engineering/building-self-driving-kafka-clusters-using-open-source-components/"
source: "Slack Engineering"
published: "2022-02-11"
difficulty: "medium"
kind: "Case study"
reading_minutes: 11
tags: ["messaging","scalability","sre","chaos-engineering","infrastructure-as-code"]
---

# Building Self-driving Kafka clusters using open source components

A post on [Slack Engineering](https://swe.quest/sources/slack.md), published 2022-02-11, 11 min read, Case study. Original: [https://slack.engineering/building-self-driving-kafka-clusters-using-open-source-components/](https://slack.engineering/building-self-driving-kafka-clusters-using-open-source-components/)

## Summary

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.

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)
- [Scaling](https://swe.quest/tags/scalability.md) (Distributed systems)
- [SRE](https://swe.quest/tags/sre.md) (Reliability & operations)
- [Chaos engineering](https://swe.quest/tags/chaos-engineering.md) (Reliability & operations)
- [Infrastructure as code](https://swe.quest/tags/infrastructure-as-code.md) (Infrastructure)

## Prerequisites

- Kafka partitions and brokers ([easy posts on Queues & messaging](https://swe.quest/tags/messaging.md?difficulty=easy))
- AWS Auto Scaling Groups ([easy posts on Cloud platforms](https://swe.quest/tags/cloud.md?difficulty=easy))
- Zookeeper basics

## Keywords

Apache Kafka, Cruise Control, Zookeeper, Kafka Manager, Terraform, Chef, Consul, Prometheus

## Related posts

- [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.
- [How we built reliable log delivery to thousands of unpredictable endpoints](https://swe.quest/articles/how-we-built-reliable-log-delivery-to-thousands-of-unpredictable-endpoints-0cf63fb1f4da9cac.md): Datadog Engineering · 2025-06-23 · Medium · 14 min read · Observability, System design, Multi-tenancy, Resilience, Queues & messaging
  Datadog's Log Forwarding avoids head-of-line blocking from Kafka's per-partition FIFO ordering by moving logs out of Kafka early into cloud object storage, grouped by destination.
- [How We Built Automated Capacity Testing for Kafka Consumers](https://swe.quest/articles/how-we-built-automated-capacity-testing-for-kafka-consumers-bca74c5a1d624617.md): Booking.com Engineering · 2026-09-14 · Medium · 7 min read · Queues & messaging, Capacity planning, Resilience, Testing, SRE
  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.
- [Break Stuff on Purpose](https://swe.quest/articles/break-stuff-on-purpose-87dc2221ffb9f4a6.md): Slack Engineering · 2024-12-10 · Medium · 5 min read · Chaos engineering, Incidents & postmortems, Observability, SRE
  Slack's internal Kibana cluster failed in January 2024 after running out of disk, a consequence of co-locating its Elasticsearch storage on the same hosts as the application.
- [Slack’s Migration to a Cellular Architecture](https://swe.quest/articles/slack-s-migration-to-a-cellular-architecture-7c9634739e313402.md): Slack Engineering · 2023-08-22 · Medium · 8 min read · Resilience, Load balancing, Distributed systems, Cloud platforms, SRE
  Slack moved its critical user-facing services in us-east-1 to a cellular architecture where each availability zone is a cell that can be drained, after a 2021 gray-failure network outage in one AZ caused user-visible errors across all AZs.

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)
