Skip to content

Commit f9dd093

Browse files
Update shards per resource guidance
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
1 parent 2a23282 commit f9dd093

File tree

1 file changed

+20
-30
lines changed

1 file changed

+20
-30
lines changed

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

Lines changed: 20 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,17 @@ This decreases the number of segments, which means less metadata is kept in
6868
heap memory.
6969

7070
Every mapped field also carries some overhead in terms of memory usage and disk
71-
space. By default {es} will automatically create a mapping for every field in
71+
space. While the exact amount resource usage of each additional field depends
72+
on the type of field, an additional 512 bytes in memory use for each additional
73+
mapped field on data nodes is a good approximation in most cases.
74+
As a result, the more fields the mappings in your indices contain, the fewer
75+
indices and shards will each individual data node be able to hold,
76+
all other things being equal. In addition to the per field overhead you should
77+
at least have an additional 512Mb of heap available per data node.
78+
For example, holding 1000 indices that each contain 4000 fields will require
79+
1000 x 4000 x 512b = 2Gb for the fields and another 512Mb for a total of
80+
at least 2.5Gb on the data node.
81+
By default {es} will automatically create a mapping for every field in
7282
every document it indexes, but you can switch off this behaviour to
7383
<<explicit-mapping,take control of your mappings>>.
7484

@@ -175,35 +185,15 @@ index prirep shard store
175185

176186
[discrete]
177187
[[shard-count-recommendation]]
178-
==== Aim for 20 shards or fewer per GB of heap memory
179-
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.
185-
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.
189-
190-
To check the current size of each node's heap, use the <<cat-nodes,cat nodes
191-
API>>.
192-
193-
[source,console]
194-
----
195-
GET _cat/nodes?v=true&h=heap.current
196-
----
197-
// TEST[setup:my_index]
198-
199-
You can use the <<cat-shards,cat shards API>> to check the number of shards per
200-
node.
201-
202-
[source,console]
203-
----
204-
GET _cat/shards?v=true
205-
----
206-
// TEST[setup:my_index]
188+
==== Aim for 3000 indices or fewer per GB of heap memory on master nodes
189+
190+
The number of indices a master node can manage is proportional to the node's
191+
heap memory. The exact amount of heap memory each additional index requires
192+
depends on various factors. The include but are not limited to the size of its mapping,
193+
the number of shards per index or whether its mapping is shared with other indices.
194+
A good rule of thumb is to aim for 3000 indices or fewer per GB of heap on master nodes.
195+
For example, if your cluster contains 12,000 indices and each master node should have
196+
at least 4GB of heap available.
207197

208198
[discrete]
209199
[[avoid-node-hotspots]]

0 commit comments

Comments
 (0)