4

Attempts to raise the maximum number of systemwide processes above 2500 fail.

$ sudo sysctl -w kern.maxproc=2500
kern.maxproc: 2500 -> 2500
$ sudo sysctl -w kern.maxproc=2501
kern.maxproc: 2500
sysctl: kern.maxproc: Invalid argument

In an archived Apple article, it's mentioned that as of OSX Server 10.6, maxproc was 2500 for each 8 GB of installed RAM.

I'm running OSX 10.9 (non-Server), with 16 GB of RAM, on a 2012 MacBook Pro.

By comparison, the ubuntu linux VM running under OSX supports over 30 000 processes without any special configuration.

Is it possible to raise this limit above 2500? I've already run up against the default limit of 1000 without a great deal of effort.

6

Unfortunately it seems like maxproc is limited to 2500 with OS X unless you install OS X Server. With Server installed you can run the serverinfo tool to set high performance mode.

Just tried this myself and it seems to work.

$ sudo serverinfo --setperfmode YES
Server performance mode was enabled.

Rebooted.

$ sudo sysctl kern.maxproc
kern.maxproc: 5000

I didn't even need to change maxproc, after rebooting it was already set to 5000.

2
  • Any idea if it's possible to raise it above 5000 under Server? I suspect that doubling it isn't going to be enough. It seems silly that I might have to go back to running Linux just because it supports a higher number of processes. – intuited Oct 13 '14 at 13:57
  • 1
    I'm fairly sure you can raise it to a higher number. I think I found a reliable source that mentioned higher numbers. I'll see if I can find a reliable source when I get home. – Alistair McMillan Oct 13 '14 at 14:02
2

The idea is the same as Alistair, but we have to use other command in OS X El Capitan.

sudo nvram boot-args="serverperfmode=1 $(nvram boot-args 2>/dev/null | cut -f 2-)"

# Check "high performance mode" is enabled.
$ nvram boot-args 
nvram: Error getting variable - 'boot-args': (iokit/common) data was not found

# Enable high performance mode
$ sudo nvram boot-args="serverperfmode=1 $(nvram boot-args 2>/dev/null | cut -f 2-)" 

# Now high performance mode is enabled.
$ nvram boot-args 
boot-args   serverperfmode=1 

http://support.apple.com/kb/HT5359

1
  • I wanted to post this answer as an comment of Alistair's answer but I don't have enough reputation on apple stackexchange. sorry! – gecko655 Jul 14 '16 at 5:56

You must log in to answer this question.

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