Skip to main content
Per-shard sizing lets you adjust the VTTablet size of individual shards in a sharded Vitess keyspace instead of resizing the whole keyspace. A shard that takes more traffic can run more CPU and memory than the rest of the keyspace, and on Metal it can run more local storage. Enable per-shard sizing from the keyspace Shards tab, then set a size on any shard. Shards you don’t set keep the keyspace default.

Eligibility

Per-shard sizing is available on a Vitess keyspace that:
  • Has two or more shards, all covering equal key ranges. A four-shard keyspace named -40, 40-80, 80-c0, c0- is eligible. One named -80, 80-c0, c0-, where the first shard covers half the keyspace and the others cover a quarter each, is not.
  • Is not imported or external
If Enable per-shard sizing is not shown on the Shards tab, the keyspace is not eligible. You cannot enable per-shard sizing while a keyspace resize or deploy request is in progress.

Enable per-shard sizing

Enabling per-shard sizing is metadata only. Existing key ranges, VSchema, routing, and the keyspace default cluster size stay the same until you resize a shard.
1
In the PlanetScale dashboard, open the Vitess database and select the branch.
2
Open the keyspace and go to the Shards tab.
3
Click Enable per-shard sizing. The dialog confirms the shard count and default size, for example: “This keyspace has N shards with a default size of PS-X. Once enabled you will be able to adjust the sizes of individual shards.”
4
Confirm. You can then set sizes on individual shards, or leave shards on the keyspace default.

Resize a shard

After per-shard sizing is enabled, resize a shard the same way you resize a keyspace: pick a cluster size and save. This changes the CPU, memory, and, on Metal, the local storage for that shard’s primary and replicas. Clearing a shard’s size returns it to the keyspace default. All shards in a keyspace must stay on the same storage class: all Metal or all network-attached storage. The size picker only lists sizes that match the keyspace storage class.

Need help?

Get help from the PlanetScale Support team, or join our Discord community to see how others are using PlanetScale.