OS X has a very small maximum limit of the number of processes you can run. How did I discover this? Well, our webserver was suddenly denying connections, even though the maximum limit was set to 500, and we weren't getting 500 concurrent connections! If you don't raise the limits, and you reach them, you're locked out of even shutting down or restarting! Here's how to raise them:
in /etc/sysctl.conf:
kern.maxproc=2048
kern.maxprocperuid=512
--
in /etc/rc:
#
# ####################################################################
#
# ADDED TO PREVENT SYSTEM LOCKUP
#
# ####################################################################
#
sysctl -w kern.maxproc=2048
sysctl -w kern.maxprocperuid=512
--
in /etc/rc.common:
#######################
# Configure the shell #
#######################
# ####################################################################
#
# ADDED TO CANCEL OUT THE LIMIT OF THE NUMBER OF PROCESSES
#
# ####################################################################
ulimit -u 512
# #######################
The above additions will allow more processes to run (512 per user id, maximum of 2048 total). See Mac OS X client has a relatively conservative setting of 512 for kern.maxproc, while Mac OS X Server sets this to 2048. So I upped this as well and things seem to be going more smoothly on our servers.
