nodetool tablestats
Displays detailed statistics for tables including read/write latencies, SSTable counts, partition sizes, and space usage.
Synopsis
Section titled “Synopsis”nodetool [connection_options] tablestats [options] [--] [keyspace[.table] ...]See connection options for connection options.
Description
Section titled “Description”nodetool tablestats provides comprehensive metrics for tables including:
- Read and write operation counts and latencies
- SSTable counts and sizes
- Partition statistics (count, size)
- Bloom filter and compression metrics
- Memtable information
- Percent repaired (for incremental repair)
This is one of the most important commands for capacity planning and performance analysis.
Arguments
Section titled “Arguments”| Argument | Description |
|---|---|
keyspace | Display stats for all tables in keyspace |
keyspace.table | Display stats for specific table |
Options
Section titled “Options”| Option | Description |
|---|---|
-H, --human-readable | Display sizes in human-readable format |
-F, --format | Output format (json, yaml) |
-s, --sort | Sort by column (read, write, space, etc.) |
-t, --top | Show only top N tables |
-i, --ignore | Ignore specific keyspaces/tables |
-l, --sstable-location-check | Verify SSTable locations match expected data directories |
Output Example
Section titled “Output Example”Keyspace : my_keyspace Read Count: 12345678 Read Latency: 0.234 ms Write Count: 9876543 Write Latency: 0.123 ms Pending Flushes: 0
Table: users SSTable count: 12 Old SSTable count: 0 Max SSTable size: 128 MB Space used (live): 1.5 GB Space used (total): 1.8 GB Space used by snapshots (total): 256 MB Memtable cell count: 12345 Memtable data size: 64 MB Memtable switch count: 234 Speculative retries: 0 Local read count: 5678901 Local read latency: 0.456 ms Local write count: 3456789 Local write latency: 0.123 ms Pending flushes: 0 Percent repaired: 98.5 Bloom filter false positives: 123 Bloom filter false ratio: 0.00001 Bloom filter space used: 24 MB Compression ratio: 0.35 Compacted partition minimum bytes: 64 Compacted partition maximum bytes: 65536 Compacted partition mean bytes: 1024 Average live cells per slice (last five minutes): 12.5 Maximum live cells per slice (last five minutes): 150 Average tombstones per slice (last five minutes): 0.5 Maximum tombstones per slice (last five minutes): 10 Dropped mutations: 0 Droppable tombstone ratio: 0.05Key Metrics Explained
Section titled “Key Metrics Explained”Read/Write Latencies
Section titled “Read/Write Latencies”| Metric | Description | Healthy Range |
|---|---|---|
| Local read latency | Average read time | < 5ms (SSD), < 20ms (HDD) |
| Local write latency | Average write time | < 1ms |
High Read Latency
Read latency > 10ms consistently may indicate:
- Large partitions
- Too many SSTables
- Bloom filter issues
- Disk I/O problems
SSTable Metrics
Section titled “SSTable Metrics”| Metric | Description | Action Threshold |
|---|---|---|
| SSTable count | Number of SSTables | > 20-30 warrants investigation |
| Max SSTable size | Largest SSTable | Varies by compaction strategy |
| Space used (live) | Data excluding tombstones | Capacity planning |
| Space used (total) | All data including tombstones | Disk usage |
SSTable Count
High SSTable counts increase read latency and memory usage:
- STCS: May have many SSTables naturally
- LCS: Should be mostly in L1+
- TWCS: One per time window
Partition Statistics
Section titled “Partition Statistics”| Metric | Description | Warning Signs |
|---|---|---|
| Compacted partition mean bytes | Average partition size | > 100MB is large |
| Compacted partition maximum bytes | Largest partition | > 100MB needs attention |
| Live cells per slice | Cells read per query | > 10000 may be problematic |
Large Partitions
Large partitions cause:
- Heap pressure
- GC issues
- Uneven load distribution
- Repair/compaction problems
Tombstone Metrics
Section titled “Tombstone Metrics”| Metric | Description |
|---|---|
| Tombstones per slice | Tombstones scanned per read |
| Droppable tombstone ratio | Ratio of tombstones eligible for GC |
Tombstone Warnings
High tombstones per slice indicates:
- Delete-heavy workload
- Queries scanning past deletes
- Potential for tombstone warnings in logs
Bloom Filter
Section titled “Bloom Filter”| Metric | Description |
|---|---|
| Bloom filter false positives | Incorrect positive matches |
| Bloom filter false ratio | False positive rate |
| Bloom filter space used | Memory for bloom filters |
Target false ratio: < 0.01 (1%)
Compression
Section titled “Compression”| Metric | Description |
|---|---|
| Compression ratio | Compressed size / uncompressed size |
- 0.3-0.5 is typical for most data
- < 0.2 indicates highly compressible data
-
0.8 may indicate compression isn't helping
Examples
Section titled “Examples”All Tables in Keyspace
Section titled “All Tables in Keyspace”nodetool tablestats my_keyspaceSpecific Table
Section titled “Specific Table”nodetool tablestats my_keyspace.usersHuman-Readable Sizes
Section titled “Human-Readable Sizes”nodetool tablestats -H my_keyspaceTop 10 Tables by Read Count
Section titled “Top 10 Tables by Read Count”nodetool tablestats -s reads -t 10JSON Output
Section titled “JSON Output”nodetool tablestats -F json my_keyspace.usersExtract Specific Metrics
Section titled “Extract Specific Metrics”# SSTable counts for all tablesnodetool tablestats | grep -E "Table:|SSTable count"
# Read latenciesnodetool tablestats | grep -E "Table:|Local read latency"
# Space usagenodetool tablestats | grep -E "Table:|Space used"Compare Across Nodes
Section titled “Compare Across Nodes”for node in node1 node2 node3; do echo "=== $node ===" ssh "$node" "nodetool tablestats my_keyspace.users | grep -E "SSTable|Space|latency""doneCommon Analysis Patterns
Section titled “Common Analysis Patterns”Finding Large Partitions
Section titled “Finding Large Partitions”nodetool tablestats | grep -A2 "Table:" | grep -E "Table:|maximum bytes"Tables with max partition > 100MB need data model review.
Identifying Tables Needing Compaction
Section titled “Identifying Tables Needing Compaction”nodetool tablestats | grep -A5 "Table:" | grep -E "Table:|SSTable count"High SSTable counts may indicate compaction falling behind.
Checking Tombstone Issues
Section titled “Checking Tombstone Issues”nodetool tablestats | grep -E "Table:|tombstones per slice|Droppable"High tombstones per slice correlates with read latency issues.
Repair Status
Section titled “Repair Status”nodetool tablestats | grep -E "Table:|Percent repaired"Track incremental repair progress.
Performance Baselines
Section titled “Performance Baselines”Healthy Metrics
Section titled “Healthy Metrics”| Metric | Target |
|---|---|
| Local read latency | < 5ms |
| Local write latency | < 1ms |
| SSTable count | < 20-30 |
| Bloom filter false ratio | < 0.01 |
| Tombstones per slice | < 100 |
| Partition mean bytes | < 10MB |
Warning Thresholds
Section titled “Warning Thresholds”| Metric | Warning Level |
|---|---|
| Local read latency | > 20ms |
| SSTable count | > 50 |
| Bloom filter false ratio | > 0.1 |
| Tombstones per slice | > 1000 |
| Partition maximum bytes | > 100MB |
Troubleshooting with tablestats
Section titled “Troubleshooting with tablestats”Slow Reads
Section titled “Slow Reads”Check these metrics:
- SSTable count - too many?
- Partition size - too large?
- Tombstones per slice - too many?
- Bloom filter false ratio - ineffective?
High Disk Usage
Section titled “High Disk Usage”Check:
- Space used by snapshots - orphaned snapshots?
- Droppable tombstone ratio - need compaction?
- Compression ratio - compression working?
Memory Issues
Section titled “Memory Issues”Check:
- Bloom filter space - large tables consume heap
- Memtable size - appropriate for workload?
- Partition sizes - large partitions stress heap
Related Commands
Section titled “Related Commands”| Command | Relationship |
|---|---|
| tpstats | Thread pool statistics |
| proxyhistograms | Coordinator-level latencies |
| compactionstats | Active compaction information |
| info | Node-level overview |