How many open files/handles should ES have?

5.6.4 on CentOS 7

[root@localhost ~]# lsof |grep elasticsearch|wc -l
6780

is that a normal number?

This ES instance is behind logstash, fwiw. The same command against logstash shows 170-200 open files.

Hmmm. I have a simple three node setup(ES 5.3.0) running on my home server(Darwin OS X) and it has

$> lsof | grep elasticsearch | wc -l
    4670

Whether it should have this many or not, I don't know :frowning:

Using lsof is not an accurate way to count file descriptors (memory-mapped portions of a file, duplicate file descriptors because of counting per thread, etc.). Instead, please check: ls -al /proc/<PID>/fd.

How do I dynamically derive the pid so I can run the command in one step?

OK, now here is the story:

ls -al /proc/1109/fd -- logstash
203

ls -al /proc/1802/fd -- elasticsearch
548

better, yes?

The answer is is this command:

ls -al /proc/`pgrep -f logstash`/fd |wc -l

To see it unmangled, here is where I found it:

I edited your post.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.