Skip to content

AxonOps — AI-Native Control Plane for Open Source Data Platforms

nodetool getcompactionthroughput

Displays the current compaction throughput limit.


Terminal window
nodetool [connection_options] getcompactionthroughput [options]

See connection options for connection options.

OptionDescription
-d, --precise-mibDisplay precise MiB/s value as a decimal (avoids rounding errors when configured value is not an integer)

nodetool getcompactionthroughput returns the maximum rate at which compaction operations can write data, measured in mebibytes per second (MiB/s). The output also includes current throughput metrics for the last 1/5/15 minute intervals. This throttle helps prevent compaction from consuming excessive disk I/O and impacting read/write performance.

Compaction throughput affects:

  • SSTable merge operations - How fast SSTables are combined
  • Disk I/O utilization - Balance between compaction and client traffic
  • Compaction backlog - How quickly pending compactions complete
  • Read performance - Fewer SSTables means faster reads

Current compaction throughput: 64 MiB/s
throughput_1min: 45 MiB/s
throughput_5min: 52 MiB/s
throughput_15min: 48 MiB/s
ValueMeaning
64 MiB/sDefault throughput limit
0 MiB/sUnlimited (no throttling)
16-256 MiB/sTypical operational range

Terminal window
nodetool getcompactionthroughput

Output:

Current compaction throughput: 64 MB/s
Terminal window
ssh 192.168.1.100 "nodetool getcompactionthroughput"
Terminal window
for node in node1 node2 node3; do
echo -n "$node: "
ssh "$node" "nodetool getcompactionthroughput"
done
Terminal window
nodetool getcompactionthroughput | awk '{print $4}'

Output:

64

Cassandra limits the rate at which compaction writes output SSTables:

  1. Compaction reads input SSTables
  2. Merges and processes data in memory
  3. Writes output SSTables at throttled rate
  4. Rate is controlled by compaction throughput setting
ThroughputCompaction SpeedI/O ImpactUse Case
16 MB/sVery slowMinimalHeavy read load
32 MB/sSlowLowNormal production
64 MB/sModerateModerateDefault/balanced
128 MB/sFastHighMaintenance windows
256+ MB/sVery fastVery highDedicated compaction
0 (unlimited)MaximumMaximumRecovery/emergency

Check current throughput setting:

Terminal window
nodetool getcompactionthroughput

Verify current value before making changes:

Terminal window
# Check current
nodetool getcompactionthroughput
# Adjust if needed
nodetool setcompactionthroughput 128
# Verify change
nodetool getcompactionthroughput

When investigating compaction performance:

Terminal window
# Check throughput limit
nodetool getcompactionthroughput
# Check current compaction activity
nodetool compactionstats
# Check if throughput is the bottleneck
# (compare active rate vs configured limit)

Verify consistency across nodes:

#!/bin/bash
# Check compaction throughput on all nodes
echo "=== Compaction Throughput Audit ==="
for node in $(nodetool status | grep "^UN" | awk '{print $2}'); do
throughput=$(ssh "$node" "nodetool getcompactionthroughput 2>/dev/null | awk '{print $4}')"
echo "$node: $throughput MB/s"
done

Terminal window
# Check configured limit
nodetool getcompactionthroughput
# Check actual compaction activity
nodetool compactionstats

Example compactionstats output:

pending tasks: 5
- system_schema.tables: 0
- my_keyspace.my_table: 5
Active compaction:
Compacting (my_keyspace.my_table)
Progress: 45.2% (2.3/5.1 GB)
Throughput: 62.5 MB/s

If "Throughput" consistently matches the configured limit, compaction is being throttled.

IndicatorSymptom
Growing pending tasksnodetool compactionstats shows increasing backlog
High SSTable countnodetool tablestats shows many SSTables
Read latency increaseMore SSTables to scan for reads
Disk usage growthUncompacted data accumulating
IndicatorSymptom
I/O saturationHigh disk utilization (iostat)
Read/write latencyClient operations slowed
Dropped messagesnodetool tpstats shows drops
CPU pressureCompaction using too much CPU

The default compaction throughput is 64 MB/s in Cassandra 4.x and later.

The cassandra.yaml parameter name varies by version:

Cassandra VersionParameter NameExample
Pre-4.1compaction_throughput_mb_per_sec64
4.1+compaction_throughput64MiB/s
# cassandra.yaml (4.1+)
compaction_throughput: 64MiB/s
# cassandra.yaml (Pre-4.1)
# compaction_throughput_mb_per_sec: 64

SettingPurposeCommand
Compaction throughputSSTable write rate limitgetcompactionthroughput / setcompactionthroughput
Stream throughputNode-to-node transfer rategetstreamthroughput / setstreamthroughput
Concurrent compactorsParallel compaction threadsgetconcurrentcompactors / setconcurrentcompactors
Terminal window
# Check all compaction-related settings
echo "=== Compaction Settings ==="
echo "Throughput: $(nodetool getcompactionthroughput)"
echo "Concurrent compactors: $(nodetool getconcurrentcompactors)"
echo ""
echo "=== Current Activity ==="
nodetool compactionstats

Effective throughput = throughput_per_compactor × concurrent_compactors


  • Compaction backlog growing
  • Many pending compaction tasks
  • During maintenance windows
  • SSTable count too high
Terminal window
# Check current
nodetool getcompactionthroughput
# Increase for maintenance
nodetool setcompactionthroughput 128
# Monitor progress
watch nodetool compactionstats
  • High client latencies during compaction
  • I/O contention observed
  • Disk utilization too high
  • During peak traffic periods
Terminal window
# Check current
nodetool getcompactionthroughput
# Reduce to minimize impact
nodetool setcompactionthroughput 32
# Verify client latencies improve
nodetool proxyhistograms

#!/bin/bash
# compaction_monitor.sh - Monitor compaction throughput and activity
while true; do
clear
echo "=== Compaction Monitor $(date) ==="
echo ""
# Configured limit
echo "Configured throughput: $(nodetool getcompactionthroughput)"
echo ""
# Current activity
echo "Current compaction activity:"
nodetool compactionstats
echo ""
echo "Press Ctrl+C to exit"
sleep 10
done

Terminal window
nodetool getcompactionthroughput
# Output: Current compaction throughput: 0 MB/s

This means compaction is unlimited (no throttling). This is intentional in some configurations but may cause I/O saturation.

Terminal window
# Set a reasonable limit
nodetool setcompactionthroughput 64

Runtime changes with setcompactionthroughput don't persist. Update cassandra.yaml:

compaction_throughput_mb_per_sec: 64
Terminal window
# Audit cluster
for node in node1 node2 node3; do
echo "$node: $(ssh "$node" "nodetool getcompactionthroughput | awk '{print $4}')""
done
# Output:
# node1: 64
# node2: 32 # Different!
# node3: 64
# Standardize
ssh node2 "nodetool setcompactionthroughput 64"

Compaction Throughput Guidelines

  1. Monitor regularly - Include in operational dashboards
  2. Consistent across cluster - Use same setting on all nodes
  3. Adjust for workload - Lower during peak, higher during maintenance
  4. Balance with streaming - Consider total I/O budget
  5. Document changes - Log when and why throughput was adjusted
  6. Persist settings - Update cassandra.yaml for permanent changes

CommandRelationship
setcompactionthroughputModify throughput limit
compactionstatsView active compactions
compactionhistoryView past compactions
setstreamthroughputSet streaming rate
tablestatsSSTable counts per table