Skip to content

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

Cassandra GC Pause Issues

Long garbage collection pauses cause application stalls, timeouts, and can trigger node failures in extreme cases.


  • Application timeouts correlating with GC events
  • "GC pause" warnings in Cassandra logs (> 200ms)
  • Nodes marked DOWN intermittently
  • Spiky latency patterns
  • nodetool tpstats showing dropped messages

Terminal window
nodetool gcstats

Healthy output:

Interval (ms) Max GC Elapsed (ms) Total GC Elapsed (ms) Stdev GC Elapsed (ms) GC Reclaimed (MB) Collections Direct Memory Bytes
1053721 45 892 12 15234 123 104857600

Problem indicators:

  • Max GC Elapsed > 500ms
  • Many collections with high elapsed time
Terminal window
# Find long pauses
grep "GC pause" /var/log/cassandra/gc.log | awk '$NF > 500 {print}' | tail -20
# Or for G1GC
grep "Pause" /var/log/cassandra/gc.log | tail -50
Terminal window
nodetool info | grep -i heap

Problem indicators:

  • Used heap consistently > 75% of max
  • Heap usage approaching max
Terminal window
# Find GC-related warnings
grep -i "gc\|pause\|heap" /var/log/cassandra/system.log | tail -50
Terminal window
# Large partitions cause heap pressure during reads
nodetool tablestats my_keyspace | grep -E "Table:|partition size"

Terminal window
# Clear key cache if very large
nodetool invalidatekeycache
# Flush memtables to reduce memory pressure
nodetool flush

Concurrent Reads/Writes

Concurrent reads/writes are configured via concurrent_reads and concurrent_writes in cassandra.yaml and require a restart to change. There is no runtime nodetool setconcurrency command.

For G1GC (recommended for heaps > 8GB):

Terminal window
# In jvm.options or jvm11-server.options
-XX:+UseG1GC
-XX:G1HeapRegionSize=16m
-XX:MaxGCPauseMillis=300
-XX:InitiatingHeapOccupancyPercent=45
-XX:ParallelGCThreads=8
-XX:ConcGCThreads=4

For CMS (legacy, heaps < 8GB):

Terminal window
-XX:+UseConcMarkSweepGC
-XX:+CMSParallelRemarkEnabled
-XX:CMSInitiatingOccupancyFraction=75
-XX:+UseCMSInitiatingOccupancyOnly

Rule of thumb:

  • Maximum heap: 8GB for most workloads
  • Heap > 16GB often increases GC pauses
  • Leave room for off-heap (page cache, bloom filters)
Terminal window
# In jvm.options
-Xms8G
-Xmx8G

Heap Sizing

Larger heaps don't always improve performance. Cassandra uses off-heap memory for many structures. 8GB is often optimal.

Cause 1: Large partitions

Terminal window
# Find large partitions
nodetool tablestats my_keyspace | grep -E "Compacted partition maximum bytes"

Fix: Redesign data model to limit partition size to < 100MB.

Cause 2: Wide rows with many columns

Fix: Limit columns per row, consider separate tables.

Cause 3: Heavy read/write load

Fix: Add nodes, optimize queries, implement caching.

Cause 4: Tombstone scans

Terminal window
nodetool tablestats my_keyspace | grep tombstone

Fix: See Tombstone Accumulation playbook.


Terminal window
# Monitor GC stats
watch -n 10 'nodetool gcstats'
# Check for reduced pause times
grep "Pause" /var/log/cassandra/gc.log | tail -20
  • Check client-side latencies
  • Verify no dropped messages: nodetool tpstats | grep -i dropped
  • Confirm node stability: nodetool status

OptionDefaultRecommendedPurpose
G1HeapRegionSizeAuto16mRegion size for G1
MaxGCPauseMillis200300Target max pause
InitiatingHeapOccupancyPercent4545-65When to start concurrent GC
ParallelGCThreadscorescoresParallel GC threads
ConcGCThreadscores/4cores/4Concurrent GC threads
WorkloadRecommended HeapNotes
Light (< 100 GB data)4-8 GBSmaller heap = faster GC
Medium (100-500 GB)8 GBSweet spot for most
Heavy (> 500 GB)8-16 GBConsider more nodes instead
Very large partitions16-31 GBFix data model if possible

  1. Monitor GC metrics - Alert on pauses > 500ms
  2. Limit partition sizes - Design for < 100MB per partition
  3. Run repairs - Enables tombstone cleanup
  4. Avoid heap > 16GB - Diminishing returns
  5. Use G1GC - Better pause time control
  6. Profile workloads - Identify memory-intensive operations

CommandPurpose
nodetool gcstatsGC statistics
nodetool infoHeap usage
nodetool tablestatsTable metrics including partition sizes
nodetool tpstatsThread pool and dropped messages