Skip to content

Commit d561eae

Browse files
original-brownbearDaveCTurnerhenningandersen
authored
Remove shards per gb of heap guidance (#86223) (#88162)
This guidance does not apply any longer. The overhead per shard has been significantly reduced in recent versions and removed rule of thumb will be too pessimistic in many if not most cases and might be too optimistic in other specific ones. => Replace guidance with rule of thumb per field count on data nodes and rule of thumb by index count (which is far more relevant nowadays than shards) for master nodes. relates #77466 Co-authored-by: David Turner <[email protected]> Co-authored-by: Henning Andersen <[email protected]> Co-authored-by: David Turner <[email protected]> Co-authored-by: Henning Andersen <[email protected]>
1 parent 3d74404 commit d561eae

File tree

1 file changed

+27
-10
lines changed

1 file changed

+27
-10
lines changed

docs/reference/how-to/size-your-shards.asciidoc

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ thread pool>>. This can result in low throughput and slow search speeds.
5555

5656
[discrete]
5757
[[each-shard-has-overhead]]
58-
==== Each index and shard has overhead
58+
==== Each index, shard and field has overhead
5959

6060
Every index and every shard requires some memory and CPU resources. In most
6161
cases, a small set of large shards uses fewer resources than many small shards.
@@ -175,17 +175,17 @@ index prirep shard store
175175

176176
[discrete]
177177
[[shard-count-recommendation]]
178-
==== Aim for 20 shards or fewer per GB of heap memory
178+
==== Aim for 3000 indices or fewer per GB of heap memory on each master node
179179

180-
The number of shards a data node can hold is proportional to the node's heap
181-
memory. For example, a node with 30GB of heap memory should have at most 600
182-
shards. The further below this limit you can keep your nodes, the better. If
183-
you find your nodes exceeding more than 20 shards per GB, consider adding
184-
another node.
180+
The number of indices a master node can manage is proportional to its heap
181+
size. The exact amount of heap memory needed for each index depends on various
182+
factors such as the size of the mapping and the number of shards per index.
185183

186-
Some system indices for {enterprise-search-ref}/index.html[Enterprise Search]
187-
are nearly empty and rarely used. Due to their low overhead, you shouldn't
188-
count shards for these indices toward a node's shard limit.
184+
As a general rule of thumb, you should aim for 3000 indices or fewer per GB of
185+
heap on master nodes. For example, if your cluster contains 12000 indices then
186+
each dedicated master node should have at least 4GB of heap. For non-dedicated
187+
master nodes, the same rule holds and should be added to the heap requirements
188+
of the other roles of each node.
189189

190190
To check the configured size of each node's heap, use the <<cat-nodes,cat nodes
191191
API>>.
@@ -205,6 +205,23 @@ GET _cat/shards?v=true
205205
----
206206
// TEST[setup:my_index]
207207

208+
[discrete]
209+
[[field-count-recommendation]]
210+
==== Allow 1kB of heap per field per index on data nodes, plus overheads
211+
212+
The exact resource usage of each mapped field depends on its type, but a rule
213+
of thumb is to allow for approximately 1kB of heap overhead per mapped field
214+
per index held by each data node. You must also allow enough heap for {es}'s
215+
baseline usage as well as your workload such as indexing, searches and
216+
aggregations. 0.5GB of extra heap will suffice for many reasonable workloads,
217+
and you may need even less if your workload is very light while heavy workloads
218+
may require more.
219+
220+
For example, if a data node holds shards from 1000 indices, each containing
221+
4000 mapped fields, then you should allow approximately 1000 × 4000 × 1kB = 4GB
222+
of heap for the fields and another 0.5GB of heap for its workload and other
223+
overheads, and therefore this node will need a heap size of at least 4.5GB.
224+
208225
[discrete]
209226
[[avoid-node-hotspots]]
210227
==== Avoid node hotspots

0 commit comments

Comments
 (0)