# Elastic shard balancing / allocation

**URL:** <https://discuss.elastic.co/t/elastic-shard-balancing-allocation/333713>\
**Category:** Elasticsearch\
**Created:** [May 18, 2023, 4:54am UTC](https://discuss.elastic.co/t/elastic-shard-balancing-allocation/333713 "2023-05-18T04:54:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Petr.Simik](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/petr.simik/32/38082_2.png) [@Petr.Simik](https://discuss.elastic.co/u/Petr.Simik)\
**Post date:** [May 18, 2023, 4:54am UTC](https://discuss.elastic.co/t/elastic-shard-balancing-allocation/333713/1 "2023-05-18T04:54:50Z")

</div>

Hi  
We are on Elastic 8.6 with 38 hot data nodes and ingesting about 140 different indices  
Top 10 indices have indexing rate about 15-50K events/sec. 20 indices has 1-20 K events/sec. And remaining 100 indices indexing in low rate 0-1000 of events/sec.  
All nodes have 8vcpu, 32GB RAM, 2TB SSD.  
As you can see in table below the cluster overflows some nodes and some are almost empty despite the fact that they all have the same capacity and performance

could you help me with some ideas what I should do to fix this issue?  
This impacts index latency and performance of the cluster.

cluster balancing paramteres are in default, I was thinking to adjust cluster.routing.allocation.balance.disk\_usage from its default 2e-11f to some other value "2e-9f" but I do not have no experience how the value affects rebalancing behavior.

| node | shards | disk.indices | disk.total | disk.used | disk.percent |
| --- | --- | --- | --- | --- | --- |
| tela12\_node | 31 | 420.8gb | 1.9tb | 427.3gb | 21 |
| tela36\_node | 108 | 726.6gb | 1.9tb | 734.7gb | 36 |
| tela21\_node | 75 | 728.6gb | 1.9tb | 734.6gb | 37 |
| tela34\_node | 155 | 929.2gb | 1.9tb | 934.9gb | 46 |
| tela13\_node | 209 | 908.2gb | 1.9tb | 914.8gb | 46 |
| tela37\_node | 142 | 951.5gb | 1.9tb | 957.7gb | 47 |
| tela33\_node | 114 | 1000gb | 1.9tb | 1008.1gb | 49 |
| tela10\_node | 224 | 1009.8gb | 1.9tb | 1016.3gb | 51 |
| tela28\_node | 217 | 1tb | 1.9tb | 1tb | 52 |
| tela22\_node | 221 | 1tb | 1.9tb | 1tb | 52 |
| tela18\_node | 199 | 1tb | 1.9tb | 1tb | 54 |
| tela35\_node | 142 | 1.1tb | 1.9tb | 1.1tb | 55 |
| tela04\_node | 195 | 1tb | 1.9tb | 1.1tb | 57 |
| tela17\_node | 216 | 1.1tb | 1.9tb | 1.1tb | 58 |
| tela14\_node | 214 | 1.1tb | 1.9tb | 1.1tb | 58 |
| tela07\_node | 215 | 1tb | 1.9tb | 1.1tb | 60 |
| tela19\_node | 236 | 1.2tb | 1.9tb | 1.2tb | 66 |
| tela24\_node | 219 | 1.3tb | 1.9tb | 1.3tb | 67 |
| tela26\_node | 219 | 1.3tb | 1.9tb | 1.3tb | 69 |
| tela02\_node | 222 | 1.2tb | 1.9tb | 1.3tb | 71 |
| tela01\_node | 232 | 1.3tb | 1.9tb | 1.4tb | 73 |
| tela16\_node | 187 | 1.4tb | 1.9tb | 1.4tb | 74 |
| tela06\_node | 203 | 1.3tb | 1.9tb | 1.4tb | 74 |
| tela05\_node | 179 | 1.3tb | 1.9tb | 1.4tb | 76 |
| tela23\_node | 206 | 1.5tb | 1.9tb | 1.5tb | 81 |
| tela32\_node | 153 | 1.6tb | 1.9tb | 1.6tb | 83 |
| tela03\_node | 213 | 1.5tb | 1.9tb | 1.6tb | 85 |
| tela30\_node | 123 | 1.7tb | 1.9tb | 1.7tb | 86 |
| tela11\_node | 176 | 1.6tb | 1.9tb | 1.7tb | 88 |
| tela27\_node | 177 | 1.7tb | 1.9tb | 1.7tb | 89 |
| tela15\_node | 149 | 1.7tb | 1.9tb | 1.7tb | 90 |
| tela29\_node | 130 | 1.7tb | 1.9tb | 1.7tb | 90 |
| tela08\_node | 120 | 1.6tb | 1.9tb | 1.7tb | 90 |
| tela38\_node | 127 | 1.8tb | 1.9tb | 1.8tb | 91 |
| tela20\_node | 94 | 1.7tb | 1.9tb | 1.7tb | 91 |
| tela09\_node | 126 | 1.6tb | 1.9tb | 1.7tb | 91 |
| tela31\_node | 159 | 1.7tb | 1.9tb | 1.8tb | 91 |
| tela25\_node | 172 | 1.7tb | 1.9tb | 1.7tb | 92 |

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/9/9/9984e9f6f43a273d71dcd6319e17e8843f49a4f4.png)

I setup index templates in appx this manner: hi-perf indices have more primary shards with sharads per node option so I utilise performance of more cpu.

| Indexing rate kEPS | Number of primary shards | shards per node |
| --- | --- | --- |
| 30+ | 15 | 1 |
| 20-30 | 15 | 1 |
| 15-20 | 10 | 1 |
| 10-15 | 8 | 1 |
| 5-10 | 6 | any |
| 1-5 | 3 | any |
| 0-1 | 1 | any |

this is my fourth post regarding this topic , the new version has brought some improvements, however this issue is still ongoing.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 15, 2023, 4:55am UTC](https://discuss.elastic.co/t/elastic-shard-balancing-allocation/333713/2 "2023-06-15T04:55:33Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
