planClusters
planClusters(
options):ClusterPlan
Defined in: packages/sharding/src/context.ts:123
Decides which cluster runs which shard, without starting anything:
clusterCount: every shard, split in contiguous blocks over that many clusters;shardsPerCluster:ceil(shards / shardsPerCluster)clusters of that size, the last one partial;- neither:
defaultClusterCountclusters.
There are never more clusters than shards: a larger count is capped (an empty cluster would hold a process for nothing). Every shard is in exactly one cluster.
Parameters
Section titled “Parameters”options
Section titled “options”Returns
Section titled “Returns”Throws
Section titled “Throws”For both options at once, or a count that is not a positive integer.