Cassandra Diagnosis Guide
Systematic approach to diagnosing Cassandra issues.
Diagnosis Framework (SDRR)
Section titled “Diagnosis Framework (SDRR)”Quick Diagnostic Commands
Section titled “Quick Diagnostic Commands”Cluster Health
Section titled “Cluster Health”# Overall statusnodetool status
# Cluster informationnodetool describecluster
# Node informationnodetool infoPerformance
Section titled “Performance”# Thread poolsnodetool tpstats
# Request latenciesnodetool proxyhistograms
# Table statisticsnodetool tablestats <keyspace>
# Compaction statusnodetool compactionstatsResource Usage
Section titled “Resource Usage”# Disk usagedf -h /var/lib/cassandranodetool status # Shows Load per node
# Memorynodetool info | grep "Heap Memory"free -h
# CPUtop -b -n 1 | head -20Common Diagnostic Scenarios
Section titled “Common Diagnostic Scenarios”High Latency
Section titled “High Latency”# 1. Check coordinator latencynodetool proxyhistograms
# 2. Check table-level latencynodetool tablehistograms <keyspace> <table>
# 3. Check for pending tasksnodetool tpstats
# 4. Check GC activitygrep "GC pause" /var/log/cassandra/gc.log | tail -20
# 5. Check compactionnodetool compactionstatsNode Down
Section titled “Node Down”# 1. Check service statussystemctl status cassandra
# 2. Check logstail -200 /var/log/cassandra/system.log
# 3. Check disk spacedf -h /var/lib/cassandra
# 4. Check OOM killerdmesg | grep -i killed
# 5. Check gossip (from another node)nodetool gossipinfoHigh CPU
Section titled “High CPU”# 1. Identify processtop -H -p $(pgrep -f CassandraDaemon)
# 2. Check compactionnodetool compactionstats
# 3. Check thread poolsnodetool tpstats
# 4. Take thread dumpjstack $(pgrep -f CassandraDaemon) > /tmp/threads.txtMemory Issues
Section titled “Memory Issues”# 1. Check heap usagenodetool info | grep "Heap Memory"
# 2. Check GC logstail -100 /var/log/cassandra/gc.log
# 3. Check off-heapnodetool info | grep "Off Heap"
# 4. Check system memoryfree -hDiagnostic Tools
Section titled “Diagnostic Tools”| Tool | Purpose |
|---|---|
nodetool | Cluster management and metrics |
cqlsh | Query testing and tracing |
jstack | Thread dumps |
jmap | Memory analysis |
jstat | GC statistics |
iostat | Disk I/O |
sar | System activity |
Query Tracing
Section titled “Query Tracing”-- Enable tracingTRACING ON;
-- Run querySELECT * FROM my_table WHERE id = ?;
-- Review trace output for:-- - Coordinator activity-- - Replica responses-- - Read repair-- - Tombstone scanningNext Steps
Section titled “Next Steps”- Common Errors - Error reference
- Playbooks - Resolution guides
- Log Analysis - Log investigation