-
Notifications
You must be signed in to change notification settings - Fork 24.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
max file descriptor issues on OS X #16813
Comments
This setting is weird. Note that it's enabled by default and the documentation says
So why do we want to disable it to increase the number of file descriptors past 10240 on OS X? I dove into the OpenJDK code to understand this flag and how it interacts with each of the major operating systems. When this flag is set, all of them basically delegate to The reason for the exception on OS X is due to this from
The constant
in When the flag is disabled, the number of file descriptors is equal to the soft limit. This is why if the soft limit is increased on OS X, then the 10240 limit can be avoided. Sneaky and rather counterintuitive. The situation with OS X gets weird though. If you look at
The limit is the minimum of the soft limit and
Wait, so is the max files still only 12288? I ran the dtrace
which gives
This then leads us to Of course, none of this makes sense on Windows (insert joke about how Windows is not a major operating system) where I note that there is a comment on the OpenJDK bug that @jaymode linked to that this this flag is going to be deprecated, but it still appears in the JDK9 sources, so I'm skeptical of that at this time. My conclusion for all of this is that this is way too complicated. I think we should take a different route than working around the limit via this JVM flag and all these others dances on OS X. Instead, I think that we should just disable the flag if the build is a snapshot build. I opened #16835. |
Closed by #16835 |
…al actions). Summary: `Too many open files` issue on MacOs. `-XX:- MaxFDLimit` - the way to stop the Java VM from restricting the number of open files to 1024 Related links: * https://stackoverflow.com/questions/16451343/java-file-limit-on-osx-lower-than-in-bash/16535804#16535804 * elastic/elasticsearch#16813 Reviewed By: jiawei-lyu fbshipit-source-id: a40d30529a561e9b7319022d56fbfee9fb48dac4
With the recent change in #16733 we introduced the notion of running in a production mode, which is detected by inspecting whether
network.host
is set. On OS X this is problematic with the Oracle JDK, since it limits the java process to10240
file descriptors by default unless the-XX:-MaxFDLimit
VM option is passed. This limit will cause elasticsearch to fail to start (see below).The JDK 7 documentation states that this option is only relevant to solaris, but according to this issue it is relevant to all platforms but the documentation won't be updated. The JDK8 documentation does not list this option anymore even though it is still in use.
Some output from a terminal:
In the above scenario, the only change to elasticsearch.yml is setting
network.host
tolocalhost
and I am running a build from master.We may want to consider adding this option to the
elasticsearch
script or documenting it.The text was updated successfully, but these errors were encountered: