Phase 9: Real-World Choke Points, Capacity Planning & Telemetry¶
Audience: Principal Database Reliability Engineer & Production Operations Specialist
Source References:src/java/org/apache/cassandra/concurrent/,src/java/org/apache/cassandra/metrics/
1. Production Choke Points & Root Cause Pathologies¶
1.1 The Large Partition Disaster (> 100 MB)¶
Cassandra warns when a partition crosses 100 Megabytes:
WARN [CompactionExecutor:3] 2026-10-15 09:40:12 CompactionTask.java:240 -
Writing large partition ecommerce/orders:user_id=108420 (148.520MiB) to sstable nb-4-big-Data.db
Why Large Partitions Destroy Performance:¶
- JVM Heap Pressure: During compaction, Cassandra must read the entire partition into memory to reconcile clustering keys and columns. A 2GB partition easily causes an Out-Of-Memory (OOM)
OutOfMemoryError: Java heap spacecrash! - Read Latency Degrades: A query must seek through tens of thousands of clustering rows.
- Repair Failure: Streaming a massive partition across the network frequently times out, causing
nodetool repairto fail.
Mitigation:¶
Introduce a bucketing salt to the partition key (e.g. (user_id, YYYY_MM)).
2. Thread Pool Telemetry & Backpressure (nodetool tpstats)¶
Cassandra organizes operations into specialized thread pools (Stage). Monitoring thread pool saturation is the primary diagnostic technique for Cassandra health:
Sample Output from nodetool tpstats:
Pool Name Active Pending Completed Blocked All time blocked
MutationStage 8 0 849201940 0 0
ReadStage 16 2 194029148 0 0
CompactionExecutor 2 5 194821 0 0
FlushWriter 1 0 84910 0 0
HintsDispatcher 0 0 4810 0 0
Message type Dropped
READ 0
MUTATION 482 <--- CRITICAL ALERT: Writes being dropped!
_TRACE 0
2.1 Diagnosing Dropped Mutations¶
- Pending Tasks: High pending tasks in
MutationStagemeans requests are queuing faster than the node can write to the CommitLog and Memtable. - Dropped Mutations: When queues overflow their capacity, Cassandra drops write mutations! The coordinator receives a timeout and returns
WriteTimeoutExceptionto the client. - Root Causes:
- Slow disk I/O on NVMe/SSD holding up CommitLog flushes.
- Long JVM GC pause freezing all execution threads.