nodetool setstreamthroughput
Sets the streaming throughput limit for inter-node data transfers.
Synopsis
Section titled “Synopsis”nodetool [connection_options] setstreamthroughput [options] <throughput>See connection options for connection options.
Description
Section titled “Description”nodetool setstreamthroughput controls the maximum rate at which data can be streamed between Cassandra nodes. Streaming occurs during:
- Repair operations - Transferring data to synchronize replicas
- Bootstrap - New nodes receiving data from existing nodes
- Rebuild - Nodes rebuilding data from other data centers
- Decommission - Nodes transferring data before leaving cluster
- Node replacement - Replacement nodes receiving data
This setting affects outgoing streams from the node where the command is executed.
Non-Persistent Setting
This setting is applied at runtime only and does not persist across node restarts. After a restart, the value reverts to the stream_throughput_outbound setting in cassandra.yaml (default: 24 MiB/s).
To make the change permanent, update cassandra.yaml:
stream_throughput_outbound: 24MiB/sOptions
Section titled “Options”| Option | Description |
|---|---|
-m, --mib | Interpret the throughput value as MiB/s instead of Mb/s |
-e, --entire-sstable-throughput | Set the entire-SSTable streaming throughput |
Arguments
Section titled “Arguments”| Argument | Description |
|---|---|
throughput | Maximum streaming rate. Default unit is megabits per second (Mb/s). Use -m for MiB/s. Use 0 for unlimited. |
Unit Clarification
By default, the argument is in megabits per second (Mb/s), not megabytes. For example:
nodetool setstreamthroughput 200= 200 Mb/s = ~25 MiB/snodetool setstreamthroughput -m 25= 25 MiB/s = ~200 Mb/s
cassandra.yaml Parameter
The corresponding cassandra.yaml parameter changed in 4.1:
| Cassandra Version | Parameter Name | Default | Unit |
|---|---|---|---|
| Pre-4.1 | stream_throughput_outbound_megabits_per_sec | 200 | Megabits/s |
| 4.1+ | stream_throughput_outbound | 24MiB/s | Various |
Examples
Section titled “Examples”Set Throughput (Megabits per Second)
Section titled “Set Throughput (Megabits per Second)”# Set to 200 Mb/s (~25 MiB/s)nodetool setstreamthroughput 200Set Throughput (MiB per Second)
Section titled “Set Throughput (MiB per Second)”# Set to 25 MiB/s using the -m flagnodetool setstreamthroughput -m 25Unlimited Streaming
Section titled “Unlimited Streaming”nodetool setstreamthroughput 0Unlimited Streaming
Setting to 0 removes all throttling. Use with caution as it may saturate network bandwidth and impact other operations.
Set Entire-SSTable Streaming Throughput
Section titled “Set Entire-SSTable Streaming Throughput”# Set entire-SSTable streaming throughputnodetool setstreamthroughput -e 200Verify Setting
Section titled “Verify Setting”nodetool setstreamthroughput 200nodetool getstreamthroughputWhen to Use
Section titled “When to Use”Speed Up Maintenance Operations
Section titled “Speed Up Maintenance Operations”During scheduled maintenance windows:
# Increase throughput for faster repairnodetool setstreamthroughput 400
# Run repairnodetool repair -pr my_keyspace
# Restore normal throughputnodetool setstreamthroughput 200Reduce Network Impact
Section titled “Reduce Network Impact”During high traffic periods:
# Reduce streaming to prioritize client trafficnodetool setstreamthroughput 100Bootstrap Optimization
Section titled “Bootstrap Optimization”When adding new nodes:
# On seed nodes (streaming sources)nodetool setstreamthroughput 300
# Monitor bootstrap progressnodetool netstatsDecommission Acceleration
Section titled “Decommission Acceleration”Speed up node removal:
# Before decommissioningnodetool setstreamthroughput 400
# Start decommissionnodetool decommission
# Monitor progresswatch nodetool netstatsMulti-DC Considerations
Section titled “Multi-DC Considerations”Adjust for cross-datacenter rebuilds:
# Lower throughput for WAN linksnodetool setstreamthroughput 50
# Start rebuildnodetool rebuild dc1
# Monitornodetool netstatsRecommended Values
Section titled “Recommended Values”By Scenario
Section titled “By Scenario”| Scenario | Throughput | Rationale |
|---|---|---|
| Default | 200 MB/s | Balanced default |
| High-performance network | 400-800 MB/s | Fast 10GbE+ networks |
| Shared network | 100-200 MB/s | Avoid impacting other traffic |
| Maintenance window | 400+ MB/s | Prioritize streaming |
| Cross-DC (WAN) | 50-100 MB/s | Limited bandwidth |
| During high load | 100 MB/s | Prioritize client traffic |
By Network Type
Section titled “By Network Type”| Network | Recommended Range |
|---|---|
| 1 GbE | 50-100 MB/s |
| 10 GbE | 200-500 MB/s |
| 25 GbE | 400-800 MB/s |
| AWS (same AZ) | 200-400 MB/s |
| AWS (cross AZ) | 100-200 MB/s |
| Cross region/WAN | 50-100 MB/s |
Workflow: Rolling Repair with Optimized Streaming
Section titled “Workflow: Rolling Repair with Optimized Streaming”#!/bin/bash# Store original valueoriginal=$(nodetool getstreamthroughput | awk '{print $4}')echo "Original streaming throughput: $original MB/s"
# Increase for repairecho "Increasing streaming throughput to 400 MB/s"nodetool setstreamthroughput 400
# Run repairecho "Starting repair..."nodetool repair -pr my_keyspace
# Restore originalecho "Restoring original throughput: $original MB/s"nodetool setstreamthroughput $original
echo "Repair complete"Workflow: Bootstrap New Node
Section titled “Workflow: Bootstrap New Node”On existing nodes (streaming sources):
# 1. Check current settingsnodetool getstreamthroughput
# 2. Increase for bootstrapnodetool setstreamthroughput 400
# 3. (Bootstrap starts on new node)
# 4. Monitor streamingwatch 'nodetool netstats | head -20'
# 5. After bootstrap completes, restorenodetool setstreamthroughput 200Relationship with Other Settings
Section titled “Relationship with Other Settings”Streaming vs Compaction
Section titled “Streaming vs Compaction”Both affect disk I/O and should be considered together:
| Setting | Affects | Command |
|---|---|---|
| Stream throughput | Node-to-node transfers | setstreamthroughput |
| Compaction throughput | Local SSTable processing | setcompactionthroughput |
# Check both settingsecho "Stream: $(nodetool getstreamthroughput)"echo "Compaction: $(nodetool getcompactionthroughput)"Total I/O Budget
Section titled “Total I/O Budget”Consider combined impact:
# During heavy streamingnodetool setstreamthroughput 300nodetool setcompactionthroughput 32 # Reduce to free I/O for streaming
# After streaming completesnodetool setstreamthroughput 200nodetool setcompactionthroughput 64 # Restore normal compactionMonitoring Streaming
Section titled “Monitoring Streaming”Check Current Activity
Section titled “Check Current Activity”nodetool netstatsOutput:
Mode: NORMALNot sending any streams.Read Repair Statistics:Attempted: 1234Mismatch (Blocking): 56Mismatch (Background): 78Pool Name Active Pending Completed DroppedLarge messages 0 0 12345 0Small messages 0 0 678901 0During Active Streaming
Section titled “During Active Streaming”nodetool netstatsOutput during bootstrap/repair:
Mode: NORMALReceiving from: /192.168.1.101 /192.168.1.101 Receiving 15 files, 2.3 GB total. Already received 1.1 GB, at 45.2 MB/s my_keyspace/my_tableSending to: /192.168.1.102 /192.168.1.102 Sending 10 files, 1.8 GB total. Already sent 900 MB, at 38.5 MB/sMonitor Progress
Section titled “Monitor Progress”# Continuous monitoringwatch -n 5 'nodetool netstats | grep -E "Receiving|Sending|MB/s"'Troubleshooting
Section titled “Troubleshooting”Streaming Too Slow
Section titled “Streaming Too Slow”If bootstrap/repair taking too long:
# Check current limitnodetool getstreamthroughput
# Check actual ratenodetool netstats | grep "MB/s"
# If rate << limit, bottleneck is elsewhere# Check: disk I/O, network, source node load
# Increase limitnodetool setstreamthroughput 400Network Saturation
Section titled “Network Saturation”If streaming impacts client traffic:
# Reduce streaming throughputnodetool setstreamthroughput 100
# Verify client latencies improvenodetool proxyhistogramsStreaming Fails
Section titled “Streaming Fails”If streams fail or timeout:
# Check streaming statusnodetool netstats
# Check for errors in logsgrep -i stream /var/log/cassandra/system.log | tail -20
# Try reducing throughput (too fast can cause issues)nodetool setstreamthroughput 100Cluster-Wide Management
Section titled “Cluster-Wide Management”Apply to All Nodes
Section titled “Apply to All Nodes”for node in node1 node2 node3; do echo "Setting streaming throughput on $node" ssh "$node" "nodetool setstreamthroughput 200"doneVerify Cluster Settings
Section titled “Verify Cluster Settings”for node in node1 node2 node3; do echo -n "$node: " ssh "$node" "nodetool getstreamthroughput"doneAutomation Script
Section titled “Automation Script”#!/bin/bash# adjust_streaming.sh - Adjust streaming throughput cluster-wide
THROUGHPUT="${1:-200}"# Get list of node IPs from local nodetool statusNODES=$(nodetool status | grep "^UN" | awk '{print $2}')
echo "Setting streaming throughput to $THROUGHPUT MB/s on all nodes"echo "=============================================="
for node in $NODES; do echo -n "$node: " ssh "$node" "nodetool setstreamthroughput $THROUGHPUT" 2>/dev/null if [ $? -eq 0 ]; then echo "OK" else echo "FAILED" fidone
echo ""echo "Verification:"for node in $NODES; do echo -n "$node: " ssh "$node" "nodetool getstreamthroughput" 2>/dev/null | awk '{print $4 " " $5}'doneBest Practices
Section titled “Best Practices”Streaming Throughput Guidelines
- Know your network - Set appropriate limits for your bandwidth
- Adjust for operations - Increase during maintenance windows
- Monitor actively - Watch
netstatsduring streaming operations - Balance with compaction - Consider total I/O budget
- Test before production - Validate settings in non-production first
- Document changes - Log when and why throughput was adjusted
- Cluster consistency - Use similar settings across nodes
- WAN awareness - Use lower settings for cross-DC operations
Related Commands
Section titled “Related Commands”| Command | Relationship |
|---|---|
| netstats | Monitor streaming activity |
| repair | Triggers streaming |
| rebuild | Triggers cross-DC streaming |
| decommission | Triggers outgoing streams |
| setcompactionthroughput | Related I/O throttle |
| getcompactionthroughput | View compaction throttle |