Consistent Hashing Ring Virtual Nodes (vnodes), Load Skew & Key Rebalance Calculator

Compute consistent hashing load balance skew from virtual nodes per physical server and rebalance %.

Key Load Standard Deviation (Skew %) 8.839 %
Keys Remapped When Adding 1 Node 7.692 %
Average Keys per Physical Node 4.167 M keys
Total Tokens Placed on Hash Ring 1,536 tokens
Inputs
Try:
nodes
Number of physical cache or database shard nodes on the ring (N).
vnodes/node
Number of virtual tokens (vnodes) assigned per physical node (e.g., 64, 128, 256).
M keys
Total distributed keys in Millions.
Results & Graph
Key Load Standard Deviation (Skew %)
8.839 %
Keys Remapped When Adding 1 Node
7.692 %
Average Keys per Physical Node
4.167 M keys
Total Tokens Placed on Hash Ring
1,536 tokens

Key Load Standard Deviation (Skew %)

Graph 1 • How the inputs feed Consistent Hashing Ring & Skew
Consistent Hashing Ring Virtual Nodes (vnodes), Load Skew & Key Rebalance Calculator • Custom Domain Schematic (Networking & Systems Performance) physicalvirtualNOut Physical Cluster Nodes N: 12 nodes • Virtual Nodes Per Physical Node: 128 vnodes/node KEY LOAD STANDARD DEVIATIO 8.839 % • Keys Remapped When Add: 7.692 % • Average Keys per Physi: 4.167 M keys Eq: LoadStdDevPct ≈ 100 / √VirtualNo
Graph 2 • Key Load Standard Deviation (Skew %) as Physical Cluster Nodes N changes (40% to 160% of current)
0 % 7.78 % 15.56 % 3.54 4.80nodes 5.30 7.20nodes 7.07 9.60nodes 8.84 12nodes 10.61 14.40nodes 12.38 16.80nodes 14.14 19.20nodes
Graph 3 • Physical Cluster Nodes N and Virtual Nodes Per Physical Node together Compares Key Load Standard Deviation (Skew %) when Virtual Nodes Per Physical Node is shifted +25% (solid) vs. −25% (dashed).
0 % 6.32 % 12.64 % --- Virtual Nodes Per Physical Node @ 75% 6.19 -30% 7.51 -15% 7.91 +0% 10.16 +15% 11.49 +30%
Summary: With 128 vnodes per node (1536 total ring tokens), per-node load standard deviation is ±8.84% around 4.17M keys/node, and scaling to 13 nodes remaps only 7.69% of keys.
Summary: With 128 vnodes per node (1536 total ring tokens), per-node load standard deviation is ±8.84% around 4.17M keys/node, and scaling to 13 nodes remaps only 7.69% of keys.
Interactive chart & math engine powered by CalculatorGraph

Formula: Consistent Hashing Ring & Skew Formula

LoadStdDevPct ≈ 100 / √VirtualNodesPerNode
KeysMovedOnScaleOut% = [ 1 / (PhysicalNodes + 1) ] × 100
LoadStdDevPct ≈ 100 / √VirtualNodesPerNode; KeysMovedOnScaleOut% = [ 1 / (PhysicalNodes + 1) ] × 100
  • physicalClusterNodesN: Number of physical cache or database shard nodes on the ring (N).
  • virtualNodesPerPhysicalNode: Number of virtual tokens (vnodes) assigned per physical node (e.g., 64, 128, 256).
  • totalKeysMillions: Total distributed keys in Millions.

Frequently Asked Questions

Does doubling vnodes from 128 to 256 halve the imbalance?

No. The skew follows one over the square root of the token count, so doubling vnodes divides it by about 1.41. On this page 128 vnodes gives 8.839% and 256 gives 6.25%. To halve the imbalance you need four times as many tokens, which is why returns diminish quickly beyond a few hundred per node.

Why does the page show 100% skew with one vnode per node?

With a single random token per server, each server owns one arc of the ring, and random arc lengths vary by about as much as their average. The standard deviation of load is therefore close to the mean load itself. This is the original problem that virtual nodes were introduced to solve, and the calculator's formula reproduces it at the extreme.

How many keys physically move when I add a node to the default cluster?

About 3.85 million. The page reports the share as 7.692%, one in thirteen, and multiplying that by the 50 million total gives the count. Those keys come in small slices from every existing node rather than all from one neighbour, because the new server's vnodes land at many points around the ring. That spreading is what keeps the rebalance from hammering a single machine.

Is the standard deviation the same as the hottest node's overload?

No. The standard deviation describes a typical node's distance from the average. The busiest node in a cluster sits further out, usually more than one standard deviation above the mean, and further still as the node count grows. The page does not calculate that peak, so add a margin above the reported skew when sizing memory or disk for the worst node.

Does replication factor change these results?

Not in this model. Replication copies each key onto the next few distinct nodes around the ring, which multiplies total stored data but leaves the relative balance broadly similar. The calculator has no replication input. If you run three replicas, each node's storage is roughly three times its owned share, and the skew percentage still applies to that larger figure.

Why does the large 48 node preset move only 2.041% of keys?

Because the new node only takes its fair share, one in forty-nine of all keys. The bigger the cluster, the smaller each node's slice and the less a single addition disturbs. With 256 vnodes each, that ring also holds 12,288 tokens and shows a 6.25% skew. Each node averages about 1.042 million keys, so adding one moves a little over a million keys in total.

What if my servers are different sizes?

Give larger servers more tokens in proportion to their capacity. A machine with twice the memory gets twice the vnodes and so, on average, twice the keys. This calculator assumes identical nodes with one vnode count, so for a mixed fleet run each server class separately to see its expected skew, remembering that the class with fewer tokens will show the larger percentage spread.

Does a better hash function reduce the skew?

Only up to a point. A poor hash that clusters keys can make balance worse than the formula predicts. A good one, such as those commonly used by distributed stores, gets you to the random spread this page models, but no further. The remaining imbalance comes from where the tokens land on the ring, and that is controlled by the vnode count.

Can rebalancing move more keys than the page says?

Yes. One over N plus one is the expected share for a balanced ring. The new node's real share depends on where its tokens fall, and with few vnodes it can take noticeably more or less. Some systems also move extra data during repair or streaming. Treat the percentage as the planning figure and allow headroom for the actual transfer.

Does the total key count change the skew percentage?

No. In this model the skew comes from how ring arcs are divided, which depends only on vnodes per node. The key total only scales the average-per-node line. With very small key counts, random placement of individual keys adds extra noise, but at tens of millions of keys that effect is tiny next to the token placement.

Twelve servers, 128 vnodes each, 50 million keys

The starting cluster is twelve physical nodes, each placing 128 virtual tokens on the ring, holding 50 million keys between them. That puts 1,536 tokens on the ring. The calculator reports four things about it.

The headline is a key load standard deviation of 8.839%. On average each node owns 4.167 million keys, and the standard deviation says how far a typical node sits from that average. The second figure is the share of keys that move if you add a thirteenth node: 7.692%, which is one divided by thirteen. The other two lines are the average load per node and the token count.

In practical terms, with these settings most nodes will hold somewhere between about 3.8 and 4.5 million keys, and a couple will sit outside that band. Adding one server will shift roughly 3.85 million keys onto it, taken in small slices from every existing node.

Why the skew is 100 divided by the square root of the vnode count

Picture the ring with only one token per server. Each server owns the arc from its token back to the previous one, and with random hash positions those arcs vary enormously. Some servers get a sliver, others get a huge stretch. The spread of arc lengths is about as large as the average arc itself, so the standard deviation is close to 100%. Set vnodes to 1 and the calculator shows exactly that: 100%.

Virtual nodes fix this by giving each server many small arcs instead of one big one. A server's load becomes the sum of V independent random pieces. When you add up V independent pieces, the average grows with V but the scatter only grows with the square root of V, so the relative spread falls as one over the square root of V. That is the formula the page uses: 100 divided by the square root of the vnodes per node.

Check it on the default. The square root of 128 is about 11.31, and 100 divided by 11.31 is 8.839. Try 16 vnodes and the answer is 25%. Try 256 and it is 6.25%. Each doubling of vnodes cuts the skew by a factor of about 1.41, not by half, which is why going from 128 to 256 buys much less than going from 16 to 32.

Why changing the node count does not move the headline

Change the node count from 12 to 18 while leaving vnodes at 128 and the headline stays at 8.839%. This is not a bug. The model treats each node's share as the sum of its own V arcs, and the relative scatter of that sum depends on V alone. More servers shrink the average load per node, from 4.167 million at twelve to 2.778 million at eighteen, but the percentage spread around that average is the same.

What does change with the node count is the worst case. With more nodes you are drawing more samples from the same distribution, so the single most loaded node tends to sit further above the mean. The page does not show this peak-to-average figure, even though the description mentions a hotspot factor. As a rough rule for a normal spread, the busiest of a dozen nodes lands one and a half to two standard deviations above the mean. On the default that is something like 13% to 18% over average, so a node carrying around 4.8 million keys rather than 4.167 million. Plan capacity against that, not against the mean.

The rebalance figure: one divided by N plus one

When a new node joins a balanced ring, it should end up with the same share as everyone else. With N old nodes and one new one, that share is one over N plus one, and every key it now owns was taken from somewhere else. So the fraction of all keys that move is one over N plus one. At twelve nodes that is 7.692%. At eighteen it is 5.263%, because one in nineteen keys moves.

Compare that with naive modulo hashing, where the server is chosen by the key's hash modulo N. Changing N from twelve to thirteen remaps almost every key, since a hash that was 5 modulo 12 is unlikely to be 5 modulo 13 as well. That near-total reshuffle is the whole reason consistent hashing exists.

Two caveats apply. First, one over N plus one is the expected figure for a ring that was balanced and stays balanced. With few vnodes the new server's actual share can be noticeably more or less than its fair share, so the real figure moves around it. Second, the page only models adding a node. Removing one moves that node's keys and nothing else, which on a balanced ring is one over N, or about 8.33% at twelve nodes.

Choosing a vnode count

More tokens means smoother balance but more bookkeeping. Every token is an entry in the ring's lookup structure, every node has to know about every token, and rebalancing streams data in many small ranges rather than a few large ones. Systems such as Cassandra have historically used values in the range of 16 to 256 tokens per node, and the variable notes on this page list 64, 128 and 256 as common choices.

A simple way to pick: decide how much imbalance you can tolerate, then invert the formula. If you want a standard deviation of about 10%, you need roughly 100 vnodes. For 5% you need about four times that. Halving the skew always costs four times the tokens.

Small clusters deserve a closer look. With three nodes and four vnodes each, the page reports a 50% standard deviation and only 12 tokens on the whole ring. That is a cluster where one node could easily carry twice the load of another. Raising vnodes is cheap at that size and usually worth it.

What the model assumes about your keys

The calculation assumes keys are spread uniformly by a good hash function and that every key costs the same. Real workloads often break the second assumption. If a few keys are much hotter or much larger than the rest, the node that owns them will be overloaded no matter how many vnodes you use, because vnodes spread key ranges, not individual keys.

In that situation the 8.839% figure describes the key count, not the traffic. Fixes for hot keys sit elsewhere: replicating the hot key to several nodes, adding a local cache in front of it, or splitting it into sub-keys.

The model also treats all physical nodes as equal. If your servers differ in size, the usual approach is to give the bigger machines proportionally more tokens. The calculator takes a single vnodes-per-node value, so to estimate a mixed cluster you would need to run each class of server separately and reason about the result.

Turning the skew into a capacity margin

The figure that matters for provisioning is not the average load but how much headroom the busiest node needs. A practical way to use this page is to start from the average, 4.167 million keys per node on the default, and add a margin built from the standard deviation.

One standard deviation above average covers roughly the top sixth of nodes in a normal spread. Two covers almost all of them. On the default, two standard deviations is about 17.7%, so a node sized for around 4.9 million keys would comfortably hold the worst likely share. With 16 vnodes the same rule asks for 50% headroom, and with one vnode it asks you to size every node for three times the average, which shows why single-token rings are impractical.

Add the rebalance on top. During a scale-out, the new node streams in its 7.692% share while still serving traffic, and the donors are reading data out at the same time. If you plan to grow the cluster while it is busy, leave room for that transfer as well as for steady-state imbalance.

Finally, check memory, disk and request rate separately. The page models key counts. If values vary in size or some ranges get more requests, measure those directly and use this skew figure as the floor rather than the full answer.

Entering the three inputs

Physical cluster nodes must be a whole number of 2 or more, and vnodes per node a whole number of 1 or more. A fractional value or a single node returns a prompt to check the inputs rather than a rounded answer, because neither describes a real ring. The two alternative presets show the range: a small ring of 6 nodes with 32 vnodes each has 192 tokens, a 17.678% skew and a 14.286% rebalance, while a large ring of 48 nodes with 256 vnodes each has 12,288 tokens, a 6.25% skew and only 2.041% of keys moving.

Vnodes per physical node is the token count your system is configured with, not the replication factor. Replication places extra copies on the next nodes around the ring and does not change ownership balance in this model.

Total keys is in millions and only affects the average-per-node line. The skew and rebalance percentages are independent of it. If you want a key count for the rebalance, multiply the total by the percentage yourself: 50 million times 7.692% is about 3.85 million keys.