Elasticsearch File Descriptors

Elasticsearch File Descriptors

Opster Team

March 2021


In addition to reading this guide, we recommend you run the Elasticsearch Health Check-Up. It will detect issues and improve your Elasticsearch performance by analyzing your shard sizes, threadpools, memory, snapshots, disk watermarks and more.

The Elasticsearch Check-Up is free and requires no installation.

Run the Elasticsearch check-up to receive recommendations like this:

checklist Run Check-Up
error

The following configuration error was detected on node 123...

error-img

Description

This error can have a severe impact on your system. It's important to understand that it was caused by...

error-img

Recommendation

In order to resolve this issue and prevent it from occurring again, we recommend that you begin by changing the configuration to...

1

X-PUT curl -H "Content-Type: application/json" [customized recommendation]

What it means

File descriptors are required so that the Elasticsearch process can keep track of all the files it has open at any given time as well as all network connections to other nodes.

Running out of file descriptors would result in the Elasticsearch process not being able to keep track of the files it has open or not being able to open new files or socket connections when it needs to, and will most probably lead to data loss.

The Elasticsearch process should be permitted up to 65,536 or more.

How to resolve it

If you used systemd or yum to install Elasticsearch, then the setting should be applied automatically. If you installed a tarball then you will need to do the following:

Edit /etc/security/limits.conf 

Add the line:

elasticsearch - nofile 65535

MacOS users must also add the following line to the jvm.options file (not necessary for Linux):

-XX:-MaxFDLimit 

Restart Elasticsearch.

You can check the setting has taken effect:

GET _nodes/stats/process?filter_path=**.max_file_descriptors

Run the Elasticsearch check-up to receive recommendations like this:

checklist Run Check-Up
error

The following configuration error was detected on node 123...

error-img

Description

This error can have a severe impact on your system. It's important to understand that it was caused by...

error-img

Recommendation

In order to resolve this issue and prevent it from occurring again, we recommend that you begin by changing the configuration to...

1

X-PUT curl -H "Content-Type: application/json" [customized recommendation]



Improve Elasticsearch Performance

Run The Analysis