2016-03-05 10:28:43 -05:00
|
|
|
[[index-modules-merge]]
|
|
|
|
== Merge
|
|
|
|
|
2017-11-29 03:44:25 -05:00
|
|
|
A shard in Elasticsearch is a Lucene index, and a Lucene index is broken down
|
2016-03-05 10:28:43 -05:00
|
|
|
into segments. Segments are internal storage elements in the index where the
|
|
|
|
index data is stored, and are immutable. Smaller segments are periodically
|
|
|
|
merged into larger segments to keep the index size at bay and to expunge
|
|
|
|
deletes.
|
|
|
|
|
|
|
|
The merge process uses auto-throttling to balance the use of hardware
|
|
|
|
resources between merging and other activities like search.
|
|
|
|
|
|
|
|
[float]
|
|
|
|
[[merge-scheduling]]
|
|
|
|
=== Merge scheduling
|
|
|
|
|
|
|
|
The merge scheduler (ConcurrentMergeScheduler) controls the execution of merge
|
|
|
|
operations when they are needed. Merges run in separate threads, and when the
|
|
|
|
maximum number of threads is reached, further merges will wait until a merge
|
|
|
|
thread becomes available.
|
|
|
|
|
|
|
|
The merge scheduler supports the following _dynamic_ setting:
|
|
|
|
|
|
|
|
`index.merge.scheduler.max_thread_count`::
|
|
|
|
|
2018-04-27 12:29:27 -04:00
|
|
|
The maximum number of threads on a single shard that may be merging at once.
|
|
|
|
Defaults to
|
2020-04-10 08:38:00 -04:00
|
|
|
`Math.max(1, Math.min(4, <<node.processors, node.processors>> / 2))` which
|
|
|
|
works well for a good solid-state-disk (SSD). If your index is on spinning
|
|
|
|
platter drives instead, decrease this to 1.
|
2016-03-05 10:28:43 -05:00
|
|
|
|