Skip to content

Commit 0120448

Browse files
authored
Expand How to tune for disk usage (#25562)
1 parent a486162 commit 0120448

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

docs/reference/how-to/disk-usage.asciidoc

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,20 +135,44 @@ PUT index
135135
--------------------------------------------------
136136
// CONSOLE
137137

138+
[float]
139+
=== Watch your shard size
140+
141+
Larger shards are going to be more efficient at storing data. To increase the size of your shards, you can decrease the number of primary shards in an index by <<indices-create-index,creating indices>> with less primary shards, creating less indices (e.g. by leveraging the <<indices-rollover-index,Rollover API>>), or modifying an existing index using the <<indices-shrink-index,Shrink API>>.
142+
143+
Keep in mind that large shard sizes come with drawbacks, such as long full recovery times.
144+
138145
[float]
139146
=== Disable `_all`
140147

141148
The <<mapping-all-field,`_all`>> field indexes the value of all fields of a
142149
document and can use significant space. If you never need to search against all
143150
fields at the same time, it can be disabled.
144151

152+
[float]
153+
=== Disable `_source`
154+
155+
The <<mapping-source-field,`_source`>> field stores the original JSON body of the document. If you don’t need access to it you can disable it. However, APIs that needs access to `_source` such as update and reindex won’t work.
156+
145157
[float]
146158
=== Use `best_compression`
147159

148160
The `_source` and stored fields can easily take a non negligible amount of disk
149161
space. They can be compressed more aggressively by using the `best_compression`
150162
<<index-codec,codec>>.
151163

164+
[float]
165+
=== Force Merge
166+
167+
Indices in Elasticsearch are stored in one or more shards. Each shard is a Lucene index and made up of one or more segments - the actual files on disk. Larger segments are more efficient for storing data.
168+
169+
The <<indices-forcemerge,`_forcemerge` API>> can be used to reduce the number of segments per shard. In many cases, the number of segments can be reduced to one per shard by setting `max_num_segments=1`.
170+
171+
[float]
172+
=== Shrink Index
173+
174+
The <<indices-shrink-index,Shrink API>> allows you to reduce the number of shards in an index. Together with the Force Merge API above, this can significantly reduce the number of shards and segments of an index.
175+
152176
[float]
153177
=== Use the smallest numeric type that is sufficient
154178

0 commit comments

Comments
 (0)