Increase The Max Number of Processes Per UID in Solaris

If you are running solaris 8 or 9, and getting strange errors like:

“VFork failed”

when you try to run commands, or

“Mar 31 10:40:32 sauron genunix: [ID 748887 kern.notice] NOTICE: out of per-user processes for uid 1234”

from the dmesg command output, the most likely cause is that you have exceeded the maximum number of processes per user that you are allowed to run on your server.

To be sure, you can run:

ps -ef | grep <uid> | wc -l

and compare that number against the v.v_proc settings from the command:

sysdef -i

There will be a lot of output from “sysdef -i”, but you are looking for “v.v_proc” and “v.v_maxup”. “v.v_proc” is the max number of processes per user, and “v.v_maxup” is the max number of processes plus the reserved number for root.

You should see something like this:

4058 maximum number of processes (v.v_proc)
99 maximum global priority in sys class (MAXCLSYSPRI)
4053 maximum processes per user id (v.v_maxup)

Since the settings in this example is 4058, if 4058 is something like what you are seeing in the output of:

ps -ef | grep <uid> | wc -l

Than you will need to increase the value of v.v_proc and v.v_maxup. The good news is it’s easy to to. The bad news is that the settings you need to change are NOT v.v_proc and v.v_maxup. It is, instead, the “maxusers” value. The other bad news is that you can’t change them dynamicly.

Here is what you will most likely want to add to your /etc/system file. Tweak the setting as needed:

set maxusers = <This should be something like the amount of available physical memory in MB>

Then reboot the system, and your maximum number of processes per user should now be set to something much more reasonable than the Solaris defaults.

As you can see, setting maxusers to a value will control max_nprocs and maxuprc. The algorythms are:
max_nprocs = 10 + (16 x maxusers)
maxuprc = max_nprocs – reserved_procs (default is 5)

As a result, usually only maxusers is tuned.

One thought on “Increase The Max Number of Processes Per UID in Solaris

  1. Pingback: Random Moments » Blog Archive » What i’ve been working on. (a big one)

Leave a Reply