How many open files/handles should ES have?


(Jose) #1

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.


(Mujtaba Hussain) #2

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:


(Jason Tedor) #3

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.


(Jose) #4

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


(Jose) #5

OK, now here is the story:

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

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

better, yes?


(Jose) #6

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:


(David Pilato) #7

I edited your post.


(system) #8

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