2016-04-03 10:09:24 -04:00
|
|
|
[[file-descriptors]]
|
|
|
|
=== File Descriptors
|
|
|
|
|
2016-10-04 10:43:03 -04:00
|
|
|
[NOTE]
|
2016-10-10 08:47:25 -04:00
|
|
|
This is only relevant for Linux and macOS and can be safely ignored if running
|
|
|
|
Elasticsearch on Windows. On Windows that JVM uses an
|
|
|
|
https://msdn.microsoft.com/en-us/library/windows/desktop/aa363858(v=vs.85).aspx[API]
|
|
|
|
limited only by available resources.
|
2016-10-04 10:43:03 -04:00
|
|
|
|
2016-04-03 10:09:24 -04:00
|
|
|
Elasticsearch uses a lot of file descriptors or file handles. Running out of
|
|
|
|
file descriptors can be disastrous and will most probably lead to data loss.
|
|
|
|
Make sure to increase the limit on the number of open files descriptors for
|
|
|
|
the user running Elasticsearch to 65,536 or higher.
|
|
|
|
|
2019-01-16 17:19:12 -05:00
|
|
|
For the `.zip` and `.tar.gz` packages, set <<ulimit,`ulimit -n 65535`>> as
|
|
|
|
root before starting Elasticsearch, or set `nofile` to `65535` in
|
2016-04-03 10:09:24 -04:00
|
|
|
<<limits.conf,`/etc/security/limits.conf`>>.
|
|
|
|
|
2017-10-05 14:56:15 -04:00
|
|
|
On macOS, you must also pass the JVM option `-XX:-MaxFDLimit`
|
|
|
|
to Elasticsearch in order for it to make use of the higher file descriptor limit.
|
|
|
|
|
2016-04-03 10:09:24 -04:00
|
|
|
RPM and Debian packages already default the maximum number of file
|
2019-01-16 17:19:12 -05:00
|
|
|
descriptors to 65535 and do not require further configuration.
|
2016-04-03 10:09:24 -04:00
|
|
|
|
|
|
|
You can check the `max_file_descriptors` configured for each node
|
|
|
|
using the <<cluster-nodes-stats>> API, with:
|
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
2016-08-26 16:18:58 -04:00
|
|
|
GET _nodes/stats/process?filter_path=**.max_file_descriptors
|
2016-04-03 10:09:24 -04:00
|
|
|
--------------------------------------------------
|
2016-08-26 16:18:58 -04:00
|
|
|
// CONSOLE
|