Skip to content

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

nodetool settimeout

Sets the timeout value for the specified type.


Terminal window
nodetool [connection_options] settimeout <timeout_type> <timeout_value_in_ms>

See connection options for connection options.

nodetool settimeout modifies the timeout value for a specific operation type at runtime. This allows adjusting timeouts without restarting the node, useful for:

  • Emergency response - Temporarily increase timeouts during performance issues
  • Workload accommodation - Adjust for queries with known longer execution times
  • Testing - Experiment with different timeout values

Runtime Change

Timeout changes take effect immediately but don't persist across restarts. For permanent changes, update cassandra.yaml.


ArgumentDescription
timeout_typeThe type of timeout to modify
timeout_value_in_msNew timeout value in milliseconds
TypeDescriptionDefault
readRead operations5000 ms
writeWrite operations2000 ms
rangeRange read operations10000 ms
counterwriteCounter write operations5000 ms
cascontentionCAS contention retries1000 ms
truncateTruncate operations60000 ms
miscMiscellaneous operations10000 ms
internodeconnectInternode connections10000 ms
internodeuserInternode user operationsvaries
internodestreaminguserInternode streaming user socket timeoutvaries

Zero Value Behavior

For internodestreaminguser, setting the value to 0 disables the socket streaming timeout entirely.


Terminal window
nodetool settimeout read 10000
Terminal window
# For large range scans
nodetool settimeout range 30000
Terminal window
nodetool settimeout write 1000
Terminal window
# Set timeout
nodetool settimeout read 10000
# Verify
nodetool gettimeout read

Temporarily increase timeouts while investigating issues:

Terminal window
# Increase read timeout during slow disk performance
nodetool settimeout read 15000
# Increase range timeout for large scans
nodetool settimeout range 60000
# After issue resolved, restore defaults
nodetool settimeout read 5000
nodetool settimeout range 10000

Accommodate queries with predictably longer execution:

Terminal window
# Large token range scans
nodetool settimeout range 30000
# Complex read operations
nodetool settimeout read 10000

When timeout errors occur but operations should succeed:

Terminal window
# Check current timeout
nodetool gettimeout read
# Increase temporarily
nodetool settimeout read 20000
# Test operation
cqlsh -e "SELECT * FROM large_table LIMIT 1000;"
# Monitor and adjust

Adjust counter write timeout for busy counter tables:

Terminal window
nodetool settimeout counterwrite 10000

EffectImpact
Fewer timeout errorsOperations wait longer
Resource usageConnections held longer
Error detectionDelayed failure detection
Client experienceLonger wait for failures
EffectImpact
More timeout errorsOperations fail faster
Resource releaseConnections freed sooner
Error detectionFaster failure detection
Client experienceQuicker error responses

Timeout Considerations

Increasing timeouts masks underlying performance issues. Use temporary increases for emergency response, but investigate and fix root causes.


emergency_timeout_adjust.sh
#!/bin/bash
echo "=== Emergency Timeout Adjustment ==="
echo ""
# 1. Record current values
echo "1. Current timeout values:"
for type in read write range; do
nodetool gettimeout $type
done
# 2. Save to restore later
echo ""
echo "2. Saving current values..."
read_timeout=$(nodetool gettimeout read 2>/dev/null | grep -oE "[0-9]+" | head -1)
write_timeout=$(nodetool gettimeout write 2>/dev/null | grep -oE "[0-9]+" | head -1)
range_timeout=$(nodetool gettimeout range 2>/dev/null | grep -oE "[0-9]+" | head -1)
echo " read=$read_timeout write=$write_timeout range=$range_timeout"
# 3. Apply emergency values (2x default)
echo ""
echo "3. Applying emergency timeout values..."
nodetool settimeout read 10000
nodetool settimeout write 4000
nodetool settimeout range 20000
echo ""
echo "4. New values:"
for type in read write range; do
nodetool gettimeout $type
done
# 4. Create restore script
echo ""
echo "5. Created restore script: /tmp/restore_timeouts.sh"
cat > /tmp/restore_timeouts.sh << EOF
#!/bin/bash
nodetool settimeout read $read_timeout
nodetool settimeout write $write_timeout
nodetool settimeout range $range_timeout
echo "Timeouts restored to original values."
EOF
chmod +x /tmp/restore_timeouts.sh
echo ""
echo "=== Emergency adjustment complete ==="
echo "Run '/tmp/restore_timeouts.sh' to restore original values."

set_timeout_cluster.sh
#!/bin/bash
TIMEOUT_TYPE="$1"
TIMEOUT_VALUE="$2"
if [ -z "$TIMEOUT_TYPE" ] || [ -z "$TIMEOUT_VALUE" ]; then
echo "Usage: $0 <timeout_type> <timeout_value_ms>"
exit 1
fi
echo "Setting $TIMEOUT_TYPE timeout to ${TIMEOUT_VALUE}ms cluster-wide..."
# Get list of node IPs from local nodetool status
nodes=$(nodetool status | grep "^UN" | awk '{print $2}')
for node in $nodes; do
echo -n "$node: "
ssh "$node" "nodetool settimeout $TIMEOUT_TYPE $TIMEOUT_VALUE" && echo "OK" || echo "FAILED"
done
echo ""
echo "Verification:"
for node in $nodes; do
echo -n "$node: "
ssh "$node" "nodetool gettimeout $TIMEOUT_TYPE"
done
set_all_timeouts.sh
#!/bin/bash
READ_TIMEOUT="${1:-5000}"
WRITE_TIMEOUT="${2:-2000}"
RANGE_TIMEOUT="${3:-10000}"
echo "Setting timeouts: read=$READ_TIMEOUT write=$WRITE_TIMEOUT range=$RANGE_TIMEOUT"
# Get list of node IPs from local nodetool status
nodes=$(nodetool status | grep "^UN" | awk '{print $2}')
for node in $nodes; do
echo "Configuring $node..."
ssh "$node" "nodetool settimeout read $READ_TIMEOUT"
ssh "$node" "nodetool settimeout write $WRITE_TIMEOUT"
ssh "$node" "nodetool settimeout range $RANGE_TIMEOUT"
done
echo "Complete."

Setting SourcePersistenceScope
settimeoutUntil restartThis node only
cassandra.yamlPermanentAll restarts
cassandra.yaml
read_request_timeout_in_ms: 10000
write_request_timeout_in_ms: 4000
range_request_timeout_in_ms: 20000
counter_write_request_timeout_in_ms: 10000
cas_contention_timeout_in_ms: 2000
truncate_request_timeout_in_ms: 60000

Terminal window
# Verify the change took effect
nodetool gettimeout read
# May need to increase further
nodetool settimeout read 30000
# Or investigate underlying performance issue
nodetool proxyhistograms
Terminal window
# Check JMX connectivity
nodetool info
# Verify valid timeout type
# Valid types: read, write, range, counterwrite, cascontention, truncate, misc
Terminal window
# Server-side timeouts affect Cassandra's internal timeouts
# Client driver timeouts are separate
# Ensure client timeout >= server timeout
# Check client driver configuration

Timeout Setting Guidelines

  1. Temporary only - Runtime changes should be temporary
  2. Document changes - Log when and why timeouts changed
  3. Restore after fix - Return to defaults once issues resolved
  4. Investigate root cause - Don't use increased timeouts as permanent fix
  5. Cluster consistency - Set same values on all nodes
  6. Monitor effect - Track if timeout errors decrease

Timeout Anti-Patterns

  • Don't set extremely high values - Masks problems, wastes resources
  • Don't leave temporary increases permanent - Update cassandra.yaml if needed
  • Don't ignore timeout errors - They indicate performance issues
  • Don't set lower than client timeouts - Client times out first

CommandRelationship
gettimeoutView current timeout values
proxyhistogramsView latency distributions
infoGeneral node information