Discourage from opting in for the niofs store. (#52638)

Indices open with the `niofs` store type load much more data on-heap than
indices open with the `mmapfs` store type. This limitation is now documented
and examples have been updated to show how to update settings to use the
`mmapfs` store type rather than `niofs`.
This commit is contained in:
Adrien Grand 2020-02-25 08:52:53 +01:00
parent 9b0ddc1c03
commit 5f81906fcf

View File

@ -3,6 +3,10 @@
The store module allows you to control how index data is stored and accessed on disk. The store module allows you to control how index data is stored and accessed on disk.
NOTE: This is a low-level setting. Some store implementations have poor
concurrency or disable optimizations for heap memory usage. We recommend
sticking to the defaults.
[float] [float]
[[file-system]] [[file-system]]
=== File system storage types === File system storage types
@ -11,12 +15,12 @@ There are different file system implementations or _storage types_. By default,
Elasticsearch will pick the best implementation based on the operating Elasticsearch will pick the best implementation based on the operating
environment. environment.
This can be overridden for all indices by adding this to the The storage type can also be explicitly set for all indices by configuring the
`config/elasticsearch.yml` file: store type in the `config/elasticsearch.yml` file:
[source,yaml] [source,yaml]
--------------------------------- ---------------------------------
index.store.type: niofs index.store.type: hybridfs
--------------------------------- ---------------------------------
It is a _static_ setting that can be set on a per-index basis at index It is a _static_ setting that can be set on a per-index basis at index
@ -27,7 +31,7 @@ creation time:
PUT /my_index PUT /my_index
{ {
"settings": { "settings": {
"index.store.type": "niofs" "index.store.type": "hybridfs"
} }
} }
--------------------------------- ---------------------------------
@ -47,15 +51,15 @@ supported systems but is subject to change.
The Simple FS type is a straightforward implementation of file system The Simple FS type is a straightforward implementation of file system
storage (maps to Lucene `SimpleFsDirectory`) using a random access file. storage (maps to Lucene `SimpleFsDirectory`) using a random access file.
This implementation has poor concurrent performance (multiple threads This implementation has poor concurrent performance (multiple threads
will bottleneck). It is usually better to use the `niofs` when you need will bottleneck) and disables some optimizations for heap memory usage.
index persistence.
[[niofs]]`niofs`:: [[niofs]]`niofs`::
The NIO FS type stores the shard index on the file system (maps to The NIO FS type stores the shard index on the file system (maps to
Lucene `NIOFSDirectory`) using NIO. It allows multiple threads to read Lucene `NIOFSDirectory`) using NIO. It allows multiple threads to read
from the same file concurrently. It is not recommended on Windows from the same file concurrently. It is not recommended on Windows
because of a bug in the SUN Java implementation. because of a bug in the SUN Java implementation and disables some
optimizations for heap memory usage.
[[mmapfs]]`mmapfs`:: [[mmapfs]]`mmapfs`::