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.

gronostaj
  • 58,482

1 Answers1

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
bmike
  • 3,070