Skip to content

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

Cassandra ReadTimeoutException

ReadTimeoutException occurs when a read operation cannot complete within the configured timeout period.

com.datastax.driver.core.exceptions.ReadTimeoutException: Cassandra timeout during read query
at consistency LOCAL_QUORUM (2 responses were required but only 1 replica responded)

Or in logs:

ERROR [ReadStage-2] ReadCallback.java:123 - Read timeout: 5000 ms

  • Client receives ReadTimeoutException
  • High read latencies in nodetool proxyhistograms
  • Increased ReadTimeout count in JMX metrics
  • Slow or unresponsive queries

Terminal window
# Overall read latencies
nodetool proxyhistograms
# Per-table latencies
nodetool tablehistograms my_keyspace my_table

What to look for: p99 latencies > timeout value (default 5000ms)

Terminal window
nodetool tablestats my_keyspace.my_table

Key metrics:

MetricWarning LevelIndicates
SSTable count> 20Compaction lag
Partition size (max)> 100MBLarge partitions
Tombstone scans> 1000Too many tombstones
Bloom filter false positive ratio> 0.01Inefficient bloom filters
Terminal window
# Enable query tracing
cqlsh> TRACING ON;
cqlsh> SELECT * FROM my_table WHERE pk = 'value';

Look for: “Scanned X tombstones” messages.

Terminal window
nodetool tpstats

Warning signs:

  • ReadStage pending > 0 across successive runs, rather than in a single sample. A queue that clears between runs is a burst; one that holds means the pool is not keeping up
  • Dropped READ messages in the second section of the output, which count reads discarded after waiting past read_request_timeout. A dropped read is not retried by the node, so it becomes the client-visible timeout
  • The same two readings on the other replicas for the affected partition, which separates one slow node from a cluster-wide limit

The Blocked and All time blocked columns stay at zero on ReadStage on 5.0, 4.1 and 4.0 whatever the load, so neither is usable here; What the blocked counters report covers why. For the work ReadStage performs and the definition of each counter above, see Thread Pools.

Terminal window
iostat -x 1 5

Warning signs:

  • %util > 80%
  • await > 10ms
  • High r_await (read wait time)
Terminal window
grep "GC pause" /var/log/cassandra/gc.log | tail -20

Warning signs:

  • GC pauses > 500ms
  • Frequent full GC

Symptoms: Single partition queries slow, multi-partition queries fast.

Verify:

Terminal window
nodetool tablestats my_keyspace.my_table | grep -i partition

Solution:

  • Redesign data model to use smaller partitions
  • Use bucketing (e.g., by time period)
  • Set partition size alerts

Symptoms: Queries become slower after deletes, slow range queries.

Verify:

Terminal window
# Run with tracing
TRACING ON;
SELECT * FROM my_table WHERE partition_key = 'x';
# Look for "Scanned X tombstones"

Solution:

  • Reduce gc_grace_seconds (after ensuring repair runs regularly)
  • Avoid deletes if possible (use TTL instead)
  • Run compaction to purge tombstones
Terminal window
nodetool compact my_keyspace my_table

Symptoms: Read latency increases over time, compaction pending.

Verify:

Terminal window
nodetool compactionstats
nodetool tablestats my_keyspace.my_table | grep "SSTable count"

Solution:

  • Increase compaction throughput
Terminal window
nodetool setcompactionthroughput 128
  • Force compaction
Terminal window
nodetool compact my_keyspace my_table

Symptoms: All operations slow, high disk utilization.

Verify:

Terminal window
iostat -x 1 10

Solution:

  • Use SSDs (required for production)
  • Check for disk issues
  • Reduce concurrent operations

Symptoms: Only some nodes show timeouts, inter-node latency high.

Verify:

Terminal window
# Check cross-node latency
nodetool netstats
# Ping test
ping -c 10 <other-node-ip>

Solution:

  • Check network infrastructure
  • Verify firewall rules
  • Check for packet loss

Symptoms: Intermittent timeouts, correlated with GC pauses.

Verify:

Terminal window
grep -E "GC|pause" /var/log/cassandra/gc.log | tail -50

Solution:

  • Confirm the heap and collector match what the release computes and ships, rather than a value set by hand (heap sizing per version)
  • Work through GC Pause Issues, which separates a pause caused by the collector configuration from one caused by what the heap retains
  • Check for unbounded growth in what the heap holds, which High Memory Usage covers

Symptoms: All operations slow, high thread pool utilization.

Verify:

Terminal window
nodetool tpstats

Solution:

  • Add nodes
  • Reduce traffic
  • Optimize queries

  1. Increase timeout (temporary fix):

    cassandra.yaml
    read_request_timeout_in_ms: 10000
  2. Reduce consistency level (if acceptable):

    CONSISTENCY LOCAL_ONE;
    SELECT * FROM my_table WHERE pk = 'x';
  3. Force compaction (if SSTable count high):

    Terminal window
    nodetool compact my_keyspace my_table
  1. Fix data model:

    • Smaller partitions (< 100MB)
    • Avoid unbounded partition growth
    • Use appropriate clustering columns
  2. Tune compaction:

    # For time-series data
    compaction = {'class': 'TimeWindowCompactionStrategy',
    'compaction_window_unit': 'HOURS',
    'compaction_window_size': '1'}
  3. Add capacity:

    • Add nodes if cluster is overloaded
    • Scale horizontally
  4. Optimize queries:

    • Add appropriate indexes
    • Use LIMIT clause
    • Avoid full table scans

Set up alerts for:

MetricWarningCritical
Read latency p99> 50ms> 500ms
SSTable count> 20> 50
ReadStage pending> 0 (sustained)> 10
GC pause time> 200ms> 500ms
  1. Design for your queries: Model data based on access patterns
  2. Keep partitions small: Target < 100MB per partition
  3. Avoid tombstones: Use TTL instead of DELETE when possible
  4. Monitor proactively: Track read latencies over time
  5. Run repairs: Keep data consistent across replicas