Skip to content

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

Cassandra Scaling Operations

This section covers horizontal scaling procedures for Cassandra clusters, including capacity planning, node addition and removal strategies, and operational best practices for maintaining cluster balance during topology changes.


Cassandra is designed for horizontal scaling—adding more nodes rather than larger nodes:

Cassandra Scaling ModelCassandra Scaling ModelHorizontal Scaling (Recommended)Vertical Scaling (Limited)3 Nodes1TB each3TB total6 Nodes500GB each3TB total3 Nodes1TB each3TB total3 Nodes2TB each6TB totalAdd 3 nodesData rebalancesUpgrade hardwareNo rebalance
ApproachAdvantagesDisadvantages
HorizontalLinear scaling, fault toleranceData movement required
VerticalNo data movementHardware limits, no added fault tolerance

Before scaling, assess current cluster state:

MetricTarget RangeAction if Exceeded
Disk usage< 50%Add nodes before 60%
CPU utilization< 60%Add nodes or optimize queries
Memory pressureHeap < 80%Tune JVM or add nodes
Read latency (p99)< 50msAdd nodes or review data model
Write latency (p99)< 25msAdd nodes or reduce batch size

For a cluster with N nodes and replication factor RF:

Data per node = (Total data × RF) / N
Example:
- Total unique data: 1 TB
- RF: 3
- Nodes: 6
- Data per node: (1TB × 3) / 6 = 500 GB

Adding nodes:

New data per node = Current data per node × (N / (N + new_nodes))
Example: Adding 3 nodes to 6-node cluster
- Current: 500 GB per node
- New: 500 GB × (6 / 9) = 333 GB per node

Data movement estimation:

Data to stream = (Total data × RF × new_nodes) / (N + new_nodes)
Example: Adding 3 nodes
- Data to stream: (1TB × 3 × 3) / 9 = 1 TB total

Node addition workflow from capacity assessment to post-bootstrap verificationNode addition workflow from capacity assessment to post-bootstrap verificationThis syntax is deprecated, you must add <<#5B9BD5>> at the end of the line, after the ';'This syntax is deprecated, you must add <<#FFC000>> at the end of the line, after the ';'This syntax is deprecated, you must add <<#70AD47>> at the end of the line, after the ';'1. Assess Current State• Disk, CPU, latency metrics• Growth projections2. Calculate Nodes Needed• Target capacity• Buffer for growth3. Schedule Addition• Low-traffic window• Multiple nodes? Stagger4. Provision Hardware• Same specs as existing• Network connectivity5. Execute Addition• Bootstrap one at a time• Monitor progress6. Verify Balance• Run repair• Monitor distribution
PracticeRationale
Add multiple of RFHelps maintain balanced distribution (mainly for single-token deployments)
Add one at a timeReduces cluster stress
Wait for NORMALEnsure complete bootstrap
Schedule during low trafficMinimize impact
Monitor existing nodesWatch for compaction backlog

Vnodes vs Single-Token

With vnodes (multiple tokens per node), adding exact multiples of RF is less critical as data is distributed across many token ranges.

When scaling across datacenters:

# Ensure proportional capacity per DC
# Example: RF=3 per DC
DC1: 6 nodes (3 replicas distributed across 6)
DC2: 6 nodes (3 replicas distributed across 6)
# Add 2 nodes to each DC to maintain balance
DC1: 8 nodes
DC2: 8 nodes
Terminal window
# Step 1: Verify cluster health
nodetool status # All UN
# Step 2: Configure new node
# cassandra.yaml with cluster settings
# Ensure same cluster_name, seeds, snitch
# Step 3: Start new node
sudo systemctl start cassandra
# Step 4: Monitor bootstrap
watch -n 5 'nodetool netstats'
# Step 5: Wait for completion (status shows UN)
nodetool status
# Step 6: Run repair on new node
nodetool repair -pr
# Step 7: (If adding multiple) Repeat for next node

With vnodes (recommended), token allocation is automatic:

cassandra.yaml
num_tokens: 16 # Default, provides good distribution
# Optional: Allocate tokens for specific keyspace
allocate_tokens_for_keyspace: my_keyspace

vnodes advantages:

  • Automatic token allocation
  • Better load distribution
  • Faster streaming (parallel)
  • Easier operations

Node removal workflow from capacity check through decommission to seed list cleanupNode removal workflow from capacity check through decommission to seed list cleanupThis syntax is deprecated, you must add <<#5B9BD5>> at the end of the line, after the ';'This syntax is deprecated, you must add <<#FFC000>> at the end of the line, after the ';'This syntax is deprecated, you must add <<#70AD47>> at the end of the line, after the ';'1. Verify Capacity• Remaining nodes can handle load• Disk space sufficient2. Check RF Constraints• N ≥ RF after removal• Per-DC requirements3. Schedule Removal• Low-traffic window• One at a time4. Decommission• nodetool decommission• Monitor streaming5. Verify Redistribution• Check data distribution• Monitor performance6. Cleanup• Update seed list if needed• Decommission hardware

Before removing nodes, verify:

ConstraintCheckConsequence if Violated
RF satisfiedNodes remaining ≥ RFDecommission blocked
Disk capacityRemaining nodes have spaceDisk full errors
PerformanceLoad can be handledLatency increase
Terminal window
# Step 1: Verify remaining capacity
# Calculate new disk usage per node
# Step 2: Check RF requirements
nodetool describering <keyspace>
# Step 3: On node being removed, run decommission
nodetool decommission
# This:
# - Streams all data to remaining nodes
# - Takes significant time (hours for large datasets)
# - Can be cancelled with nodetool abortdecommission
# Step 4: Monitor progress
watch -n 10 'nodetool netstats'
# Step 5: Verify completion
nodetool status
# Removed node should no longer appear
# Step 6: Update seed list if node was a seed
# Edit cassandra.yaml on all nodes
# Rolling restart (optional but recommended)

Token rebalancing may be necessary when:

  • Historical uneven additions created imbalance
  • Single-token clusters need redistribution
  • Significant data skew exists

With vnodes, adding/removing nodes automatically rebalances. Manual intervention is rarely needed.

Terminal window
# Check data distribution
nodetool status
# Look for significant variation in "Load" column
# Example of imbalanced cluster:
# UN 10.0.1.1 500 GB ...
# UN 10.0.1.2 800 GB ... # 60% more data
# UN 10.0.1.3 450 GB ...
# Check token ownership
nodetool ring
Imbalance CauseSolution
Partition key hotspotReview data model
Token distributionAdd nodes (vnodes auto-balance)
Uneven node specsStandardize hardware

Adding nodes equal to current count provides optimal rebalancing:

Initial: 3 nodes, 1TB each
Add: 3 nodes
Result: 6 nodes, 500GB each
Data movement: 50% of data moves (optimal)

Adding fewer nodes is possible but less efficient:

Initial: 3 nodes, 1TB each
Add: 1 node
Result: 4 nodes, 750GB each
Data movement: 25% of data moves
New node load: May still be uneven with vnodes
Multi-Region Scaling (RF=3 per region)Multi-Region Scaling (RF=3 per region)US-EASTEU-WEST6 nodesRF=3Add 39 nodes6 nodesRF=3Add 39 nodes

Guidelines:

  • Scale regions proportionally
  • Maintain RF per region
  • Consider latency requirements

Adding nodes creates streaming load:

ImpactMitigation
Network bandwidthThrottle with stream_throughput_outbound_megabits_per_sec
Disk I/OSchedule during low-traffic hours
CPU (compaction)Monitor pending compactions
MemoryEnsure heap headroom
# cassandra.yaml - Streaming throttle
# 4.1+ format (data rate)
stream_throughput_outbound: 200MiB/s
inter_dc_stream_throughput_outbound: 50MiB/s
# Pre-4.1 format
# stream_throughput_outbound_megabits_per_sec: 200
# inter_dc_stream_throughput_outbound_megabits_per_sec: 50

Decommissioning creates similar streaming load, plus:

  • Remaining nodes receive additional data
  • Compaction increases post-streaming

  • Current cluster health (all nodes UN)
  • No pending repairs or streaming
  • Disk usage < 50% on all nodes
  • Network bandwidth available for streaming
  • Maintenance window scheduled
  • Backups current (if applicable)
  • One node at a time
  • Monitor streaming progress
  • Watch for errors in logs
  • Track compaction backlog
  • Verify each node reaches NORMAL
  • All nodes show UN status
  • Data distribution is balanced
  • Performance metrics nominal
  • Repair completed on new nodes
  • Seed list updated (if applicable)
  • Documentation updated

Terminal window
# Streaming progress
nodetool netstats
# Compaction status
nodetool compactionstats
# Thread pool status
nodetool tpstats
# Overall status
nodetool status
MetricWarningCritical
Streaming stuckNo progress for 30 minNo progress for 1 hour
Pending compactions> 50> 100
Dropped messages> 0.1%> 1%
Disk usage> 70%> 80%