3

This question already has an answer here:

On a mac high sierra 10.13.3 I have 256 open files.
I want to raise it and I open a terminal and enter

sudo launchctl limit maxfiles 1000000 1000000

This doesnt change anything when I enter

ulimit -a 

I still get 256

But it does change something, because when I enter

sudo launchctl limit maxfiles 1000 1000

the system just stops working until a restart.

What is the right way to Increase number of open files in mac high sierra

Following command changes the open files just for the specific terminal session

ulimit -n 4096

marked as duplicate by Mr Shunz, elbarna, Christopher, jimmij, Anthony Geoghegan Feb 1 at 12:07

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Did you logoff or run ulimit in a new terminal? Ulimits don't update dynamically. – tk421 Mar 7 '18 at 18:02
  • after I ran the commands? I checked it in the same terminal, different and after logging off. – Bick Mar 7 '18 at 19:44
  • It should work after logging off but since ulimits are inherited it might be simpler to restart to see the maxfiles limit take effect. – tk421 Mar 7 '18 at 20:01
  • also restarted. Nothing happened. – Bick Mar 7 '18 at 20:28
  • Okay, I found unix.stackexchange.com/questions/108174/… which is the way to make your change persistent. – tk421 Mar 7 '18 at 20:46
-1

As per the link above, it didn't require a reboot to get dovecot working again. Dovecot had stopped but after doing this. Reproduced here thanks to the original author on that link, with a "launchctl load xxx" and restarting dovecot, on my Mac OSX 10.14.2 the mail started again. But, I believe that the following will be required. System Limit (Requires Reboot to Take Effect)

For 10.9 (Mavericks), 10.10 (Yosemite), 10.11 (El Capitan), and 10.12 (Sierra): You have to create a file at /Library/LaunchDaemons/limit.maxfiles.plist (owner: root:wheel, mode: 0644):

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
        "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>Label</key>
    <string>limit.maxfiles</string>
    <key>ProgramArguments</key>
    <array>
      <string>launchctl</string>
      <string>limit</string>
      <string>maxfiles</string>
      <string>262144</string>
      <string>524288</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
    <key>ServiceIPC</key>
    <false/>
  </dict>
</plist>

You should change the numbers according to your needs. They are the "soft limit" (262144) and the is "hard limit" (524288) respectively. For more information, consult the manual page by running man launchd.plist.

  • Hi, I'm afraid that this answer doesn't add anything relevant to the question, apart from simply copying a part of the answer of the linked question. – TooTea Jan 31 at 9:12

Not the answer you're looking for? Browse other questions tagged or ask your own question.