3

I an only set lower values for the launchctl limit maxfiles.

I try launchctl limit maxfiles 2048 2048 and nothing changes:

$ launchctl limit maxfiles
maxfiles    500            500
$ launchctl limit maxfiles 2048 2048
$ launchctl limit maxfiles
maxfiles    500            500
$ launchctl limit maxfiles 1024 1024
$ launchctl limit maxfiles
maxfiles    500            500
$ launchctl limit maxfiles 499
$ launchctl limit maxfiles
maxfiles    499            499

I can only set a lower value. It does not work for higher values.

2
  • 1
    Have you looked at this? Could be a result of kernel limitations or various other resource changes you may need to do. There's a few answers there that may get you there.
    – nerdwaller
    May 31, 2013 at 15:02
  • 1
    This problem is still present in OS X 10.9.0. I submitted a bug report to Apple about it (bug report #15563096). One additional thing I observed is that rebooting seems to reset something, and the command works correctly again, but only once per boot. Dec 2, 2013 at 6:06

1 Answer 1

1

You'll not have good luck trying to change this on the fly. Better is to find the launchd plist for the process you wish to affect and change the limits there. Kill the process and it will re-launch with the limits you wish as long as the system limits are not exceeded.

Here is a change log explaining exactly which lines in the xml document need to be changed for file limits. Also, be sure your limits are less than the system per process limit or launchd will ignore the plea for more files from the plist entirely.

 $ sysctl kern.maxfilesperproc

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .