"Too many open files" error on Mac OSX


(Allen Wyatt) #1

Elasticsearch is giving me "Too many open files" errors on my macbook
running OSX 10.8.3 and I can not figure out how to configure Elasticsearch
to use more files.

I've found several web pages showing how to increase the open files limit
on OSX and followed those directions, but Elasticsearch doesn't see the
increased limit.

I used sysctl (edited /etc/sysctl.conf) to increase the file limits.

I used launchctl (edited /etc/launchd.conf) to increase the file limits.

When I run the "ulimit -a" command it says "open files (-n) 400000".

When I run the "kern.maxfilesperproc" command it says
"kern.maxfilesperproc: 400000".

When I run the "kern.maxfiles" command it says "kern.maxfiles: 400000".

I run the "ulimit -S -n 120000" command in the bash script I use to start
Elasticsearch.

Whatever I do, Elasticsearch always reports (using
-Des.max-open-files=true): "max_open_files [10215]"

Suggestions?

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(Matt Weber) #2

In /etc/launchd.conf put:

limit maxfiles 400000 400000

Make sure in your ~/.bashrc file you are not setting the ulimit with
something like "ulimit -n 1024".
Open a new terminal, and run:

launchctl limit maxfiles
ulimit -a

You should see the maxfiles set to 400000 for both of those.

Hope this helps.

Thanks,
Matt Weber

On Mon, May 13, 2013 at 12:42 PM, Allen Wyatt allen.wyatt.tvly@gmail.comwrote:

Elasticsearch is giving me "Too many open files" errors on my macbook
running OSX 10.8.3 and I can not figure out how to configure Elasticsearch
to use more files.

I've found several web pages showing how to increase the open files limit
on OSX and followed those directions, but Elasticsearch doesn't see the
increased limit.

I used sysctl (edited /etc/sysctl.conf) to increase the file limits.

I used launchctl (edited /etc/launchd.conf) to increase the file limits.

When I run the "ulimit -a" command it says "open files (-n) 400000".

When I run the "kern.maxfilesperproc" command it says
"kern.maxfilesperproc: 400000".

When I run the "kern.maxfiles" command it says "kern.maxfiles: 400000".

I run the "ulimit -S -n 120000" command in the bash script I use to start
Elasticsearch.

Whatever I do, Elasticsearch always reports (using
-Des.max-open-files=true): "max_open_files [10215]"

Suggestions?

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(andydude) #3

I'm trying to use elasticsearch on maxosx as well. I've tried everything as well. I've performed all of the above steps, and I'm still getting a number (10209) that has absolutely nothing to do with the number I've entered (65536). Is it possible that the JNA code which determines the maximum number of open files in elasticsearch is broken on macosx?

$ ulimit -Sn
65536

$ launchctl limit maxfiles
maxfiles 65536 65536

$ bin/elasticsearch -f -Des.max-open-files=true
[2014-06-30 11:44:42,797][INFO ][bootstrap ] max_open_files [10209]
...
^C


(system) #4