Skip to content

Commit c41e63c

Browse files
Docs: Updated index-modules/store and setup/configuration
Explain how to set different index storage types, and added the vm settings required to stop mmapfs from running out of memory Closes #6327
1 parent be2b806 commit c41e63c

File tree

2 files changed

+44
-6
lines changed

2 files changed

+44
-6
lines changed

docs/reference/index-modules/store.asciidoc

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,40 @@ is `node`, meaning it will throttle based on the node level settings and
5050
participate in the global throttling happening. Both settings can be set
5151
using the index update settings API dynamically.
5252

53-
The following sections lists all the different storage types supported.
54-
5553
[float]
5654
[[file-system]]
57-
=== File System
55+
=== File system storage types
5856

5957
File system based storage is the default storage used. There are
60-
different implementations or storage types. The best one for the
58+
different implementations or _storage types_. The best one for the
6159
operating environment will be automatically chosen: `mmapfs` on
6260
Solaris/Linux/Windows 64bit, `simplefs` on Windows 32bit, and
6361
`niofs` for the rest.
6462

65-
The following are the different file system based storage types:
63+
This can be overridden for all indices by adding this to the
64+
`config/elasticsearch.yml` file:
65+
66+
[source,yaml]
67+
---------------------------------
68+
index.store.type: niofs
69+
---------------------------------
70+
71+
It can also be set on a per-index basis at index creation time:
72+
73+
[source,json]
74+
---------------------------------
75+
curl -XPUT localhost:9200/my_index
76+
{
77+
"settings": {
78+
"index.store.type": "niofs"
79+
}
80+
}
81+
---------------------------------
82+
83+
The following sections lists all the different storage types supported.
6684

6785
[float]
86+
[[simplefs]]
6887
==== Simple FS
6988

7089
The `simplefs` type is a straightforward implementation of file system
@@ -74,6 +93,7 @@ will bottleneck). It is usually better to use the `niofs` when you need
7493
index persistence.
7594

7695
[float]
96+
[[niofs]]
7797
==== NIO FS
7898

7999
The `niofs` type stores the shard index on the file system (maps to
@@ -90,9 +110,11 @@ Lucene `MMapDirectory`) by mapping a file into memory (mmap). Memory
90110
mapping uses up a portion of the virtual memory address space in your
91111
process equal to the size of the file being mapped. Before using this
92112
class, be sure your have plenty of virtual address space.
113+
See <<vm-max-map-count>>
93114

94115
[float]
95116
[[store-memory]]
96117
=== Memory
97118

98-
The `memory` type stores the index in main memory.
119+
The `memory` type stores the index in main memory, using Lucene's
120+
`RamIndexStore`.

docs/reference/setup/configuration.asciidoc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,22 @@ using the <<cluster-nodes-info>> API, with:
4747
curl localhost:9200/_nodes/process?pretty
4848
--------------------------------------------------
4949

50+
[float]
51+
[[vm-max-map-count]]
52+
==== Virtual memory
53+
54+
Elasticsearch uses <<mmapfs>> by default to store its indices. The default
55+
operating system limits on mmap counts is likely to be too low, which may
56+
result in out of memory exceptions. On Linux, you can increase the limits by
57+
running the following command as `root`:
58+
59+
[source,bash]
60+
-------------------------------------
61+
sysctl -w vm.max_map_count=262144
62+
-------------------------------------
63+
64+
To set this value permanently, update the `vm.max_map_count` setting in
65+
`/etc/sysctl.conf`.
5066

5167
[float]
5268
[[setup-configuration-memory]]

0 commit comments

Comments
 (0)