Shard balance is by default is confusing, can someone pls explain?

Below is the default values for balance. ES 8.9.

        "disk_usage": "2.0E-11",
        "index": "0.55",
        "threshold": "1.0",
        "shard": "0.45",
        "write_load": "10.0"

Fyi : In above default values am seeing huge difference in size and shard distribution.

My ask is : Need to keep size same across cluster irrespective of shard or index numbers, how can I achieve it? And what will be the changes required in the above variables.

I'd suggest starting with our cluster documentation to explain these values and what will happen if you change them.

I think my bigger question is, though, to understand more about the requirements? What has to be equal and why does it have to be equal, rather than using Elasticsearch defaults?

1 Like

@Kathleen_DeRusso .

- What has to be equal  ->  I want disk utilisation to be equal across.

- why does it have to be equal -> So i have no disk issues having on some 
nodes where others are  free.

- Elasticsearch defaults -> right, unable to understand what the default means,         "disk_usage": "2.0E-11". 
If I expand this -> I get 2.0e-11 = 2.0 x 10-11 = 0.000000000020 . So what does this mean? 


If you're using default sharding strategies, shards should be roughly equal in most cases if your only concern is balancing disk usage. I'd suggest only applying significant tuning if you're seeing problems.

1 Like

For that tuning first I should understand what does this setting mean 2.0e-11
for disk_usage. Seems settings are cryptic for end users.

I encourage you to read the documentation that I linked in a previous reply. This states that it's a default value and what modifying it does.

I think that the main issue here is that the documentation is not helpful in this case, it just show the defaults but does not explain how they are used, so it is indeed cryptic for end users.

This post here in the forum gives a better explanation: How to correctly determine the weight of a node - #3 by Paul_Le_Tilly

It was required to look into the code to know how the weight values are used in the calculation.

And according to the linked post, this is the formula:

Weight = ShardsLoad * cluster.routing.allocation.balance.shard / SumSettings + IndexLoad * cluster.routing.allocation.balance.index / SumSettings + WriteLoad * cluster.routing.allocation.balance.write_load / SumSettings + DiskLoad * cluster.routing.allocation.balance.disk_usage / SumSettings

1 Like

Short answer, I don't think you can do that, no matter how you change the settings, the number and size of shards will always be take into account.

It is also not expect to have a cluster balanced by disk usage, but by shard usage.

What you can do to have a more equal distribution is to try to keep the shards on a similar size and have nodes with the same hardware configuration.

1 Like

Thanks @leandrojmp for clearing this out, by maintaining equal size of shards across, should help us solve disk issues as number of shards across cluster is also a criteria as per the formulae and several more. And that could be an interim solution for us.

Also a suggestion or a feature to think upon I would say, there are use cases where we store data across different apps and ES will be a warm storage after Mysql, so at situations several mircroservices might not be able to keep same size per shard, since ES is distributed and such kind of usecases will be required just keep adding nodes to cluster and ensure size is maintained same. If such a flexibility is given for end user to alter. Its a great plus. It might be there even now, its just some more documentation on how to treat my use case keeping disk same across nodes irrespective of load/shard etc would be helpful.
Again thanks for your quick responses @Kathleen_DeRusso and @leandrojmp.
I do have registered to Bangalore Meet with ES team 25sept-24, will meet your team there.