Increasing max_file_descriptors OSX

[Solved] [2.4.3] I've set ulimit to 65000, but it keeps on showing up as 10240 when elasticsearch starts up. Is elasticsearch showing the valid max_file_descriptors?


I took @jasontedor advise from below. I set ulimit in bash_profile or bashrc or zshrc. I started ES with this command. ES_JAVA_OPTS="-XX:-MaxFDLimit" ./bin/elasticsearch worked like magic.

This situation is very complicated. :slight_smile:

To get you running quickly:

  • add the following content to /etc/sysctl.conf (create this file if it does not exist):
  • restart
  • set ulimit -n 65536
  • start the Elasticsearch process with the JVM option -XX:-MaxFDLimit (e.g., use ES_JAVA_OPTS=-XX:-MaxFDLimit)
  • verify the file descriptors are correct by sending a request to /_nodes/stats/process?pretty=1

I've written up why this is such a headache previously:

1 Like

Set the line

limit maxfiles 65536 65536

in /etc/launchd.conf and restart your Mac.

This does not work since at least Yosemite, maybe sooner. If you want to go the launchd route, you have to create /Library/LaunchDaemons/limit.maxfiles.plist with the following content:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
  <plist version="1.0">

This still requires a restart, and it still requires starting the JVM with -XX:-MaxFDLimit.

What's funny is that my max file descriptors when from 10240 to 4864, lol. It did change.

edit: This is working for me now! I put the ulimit -n 65536 in my .bash_profile an everything started working. Thanks!

Yeah I reviewed everything I did that you suggested....for some reason my max_file_discriptors when down. I started ES with ES_JAVA_OPTS="-XX:-MaxFDLimit" ./bin/elasticsearch

Was that right?

  "cluster_name": "elasticsearch",
  "nodes": {
    "0ZpLUqNERb-V_-_izVkhsA": {
      "timestamp": 1483546091076,
      "name": "Mister X",
      "transport_address": "",
      "host": "",
      "ip": [
      "process": {
        "timestamp": 1483546091076,
        "open_file_descriptors": 273,
        "max_file_descriptors": 4864,
        "cpu": {
          "percent": 3,
          "total_in_millis": 8060
        "mem": {
          "total_virtual_in_bytes": 5321494528

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