Default value of number-of-shards

Not able to find default value of number-of-shards anywhere.

akka.cluster.sharding {
  # Number of shards used by the default HashCodeMessageExtractor
  # when no other message extractor is defined. This value must be
  # the same for all nodes in the cluster and that is verified by
  # configuration check when joining. Changing the value requires
  # stopping all nodes in the cluster.
  number-of-shards = 1000
}

It’s defined here: akka/reference.conf at main · akka/akka · GitHub

Okay thanks, so if i have not added this ‘number-of-shards’ in conf. By default it is taking 1000.

We have 8 akka nodes so ideal number of shards should be 80-100 right ?

Sounds about right, but also depends on how many entities you have (so how big each shard would end up being). Note that changing it in the future requires full cluster shut down so it may make sense to calculate for a growing number of entities and cluster nodes if you do not want downtime.

Ohh okay, app is running in production.
Is there any disadvantage with 1000 shards ? with 8 nodes ?

Not really, a slight overhead in work and balancing can end up being too fine grained, but I don’t think that will be a problem in general.

It is generally much worse to have under-dimensioned the number of shards which can hinder an even balance of the entities across the cluster.

Okay thanks letting it as same for now.