[X-Unix] what the fork?

Juan Manuel Palacios jmpalaciosp at eml.cc
Mon Aug 9 19:56:29 PDT 2004


On Aug 9, 2004, at 9:48 PM, William H. Magill wrote:

>
> It's a Kernel limit.
>
> The problem usually has to do with the defaults for the number of 
> processes which any single uid may have (or even the system). 
> [Nominally - "maxprocperuser"]
>
> I don't know in Darwin, but in most Unix versions, these are NOT 
> dynamic numbers but are normally set  when the kernel is built. 
> However, because most Unix systems are optimized for multi-user time 
> sharing, and not for "scientific" work or even heavy duty programming, 
> the limits are frequently encountered doing exactly what you are 
> trying to do -- install some large package.
>
> There is nothing wrong.  The Kernel is just doing what it was told to 
> do.
>
> It looks like in Darwin, the parameter involved might be NPIDS 
> (maximum number of PIDs per process) which is set to 16. But I'm not 
> particularly conversant with the kernel.
>
> In some Unix versions these can be modified via /etc/sysconfigtab.
>

	Mac OS X allows tweaking some of these variables with sysctl(8):

$[juan at PowerBook: MacOS](58/0,0)-> sysctl kern | grep max
kern.ipc.maxsockbuf: 262144
kern.ipc.somaxconn: 128
kern.ipc.maxsockets: 512
kern.sysv.shmmax: 4194304
kern.maxvnodes = 11264
kern.maxproc = 532
kern.maxfiles = 12288
kern.argmax = 262144
kern.maxfilesperproc = 10240
kern.maxprocperuid = 100
kern.aiomax = 90
kern.aioprocmax = 16

	Passing the -w flag to sysctl, and of course invoking it as sudo, may 
help you adapt the parameter: sudo sysctl -w kern.maxprocperuid = 
<desired number>. But I say "may" because I haven't played with this 
nor tested the implications of such adjustment; so beware Victor, try 
at your own risk! Also, I'd think rebooting would bring your OS back to 
its default state, but I'm not too sure about it either.

	Hope that helps! Regards,...


		Juan


PS: While reading a bit of the /etc/rc startup script I found out it is 
setup to read from an /etc/sysctl.conf file (lines 99-104), so maybe 
you could put your changes there if you want to make them permanent 
after appropriate testing. But as I don't know the format of such file 
(it is passed through awk(1)) you would have to do your own testing; 
again, beware... mocking with the kernel is not always a good idea!!



More information about the X-Unix mailing list