I once watched a 16-node cluster fall over while its dashboard showed 30% average CPU. One node was pinned at 100%, the other fifteen were nearly asleep, and every request that touched the busy node timed out. Average load told me nothing. The cluster was only as fast as its hottest partition.

That is a hot partition, and it is one of the most common ways sharded systems underperform their hardware.

Why hashing does not save you

Sharding assigns each key to a partition, usually by hashing it. A good hash spreads keys evenly. It does nothing about how often each key is used. If one key gets 15% of all traffic, the partition that owns it gets at least 15% of the load no matter how many partitions you add.

I wrote a small simulator to see how bad this gets. Give each key a traffic share proportional to 1 / rank^s (a Zipf distribution, which is a decent model of real access patterns), hash the keys onto partitions, and measure the busiest partition against the mean.

With 1,000 keys and 16 partitions:

  • Uniform traffic (s = 0): the busiest partition carries about 1.1x its fair share. Fine.
  • Skewed traffic (s = 1.5): the busiest carries about 6.6x its fair share. Your 16-node cluster now has roughly the usable throughput of 2.5 nodes.
  • Same skew, 32 partitions: the ratio climbs to 12.8x. Doubling the cluster made the imbalance worse, because the hot key still sits on one node while the average load per node halved.

That last result surprises people. Scaling out is the reflex, and for a single hot key it moves you the wrong way on the metric that matters.

Two different problems

It helps to separate a hot key from a hot range.

A hot range comes from monotonic keys. Time-ordered IDs under range partitioning send every new write to the newest partition. The fix is to change the key shape (prefix a hash or shard ID) or to let the database split ranges automatically, as systems like CockroachDB and Spanner do.

A hot key is harder, because you cannot split one key. Automatic splitting divides a key range, and a range containing one dominant key splits into a busy half and an idle half that still holds the same key. Whatever you do has to reduce traffic to that key.

What works for a hot key

Cache it. For reads this is the cheapest fix. Watch for a stampede when the entry expires, since every client will miss at once.

Serve reads from replicas. Fine when slightly stale data is acceptable.

Salt the key. For hot writes, such as a global counter, turn counter into counter#0 through counter#15. Writers pick a random suffix, readers sum all sixteen. In the simulator, salting the hottest key 16 ways dropped the ratio from 6.6x to 2.5x. It was not a perfect fix, since the next few hottest keys still collide, but it turned an outage into a slow day.

The price is read fan-out and the loss of single-key atomicity, so salt only the keys you have measured as hot. Salting everything just makes every read expensive.

What to measure

Alert on the per-partition maximum, not the average. Track the skew ratio (busiest partition's load divided by the mean), and look at tail latency, since only the requests that hit the hot node are slow. On Kafka the same pattern shows up as one lagging partition while its siblings are caught up, usually from a skewed message key.

If you want to play with the numbers yourself, the hot partition simulator on Nodique runs in the browser and lets you change the partition count, key count, skew, and salt factor. The longer write-up of causes and fixes is in the guide to hot partitions.

The practical takeaway is small: before you add nodes, check whether the load is actually spread. If one partition is carrying the cluster, more hardware just waits next to it.