[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: max concurrent processes can't be > 257?



>>>>> "Nate" == Nate Amsden <aphro@portal.aphroland.org> writes:

 Nate> Brett wrote:
 >>  I'm running qmail and am trying to set up linux to allow for
 >> hundreds of outgoing connections at once (no, I'm not a spammer
 >> but the new admin of some very large, dynamic mailing lists). I'm
 >> using Debian Linux 2.2.18pre21 and from what I read, it should be
 >> quite possible to adjust the maximum processes per user through
 >> 'limit' (or 'ulimit' depending on the shell) rather than adjusting
 >> and recompiling the kernel. Well, I'm root, I do the adjustments
 >> to limit ('limit maxproc 1000') but when I check the logs, qmail
 >> never gets above 257 concurrency (256 is the default limit of
 >> maxproc). I do a 'limit'

 Nate> probably because you did not restart qmail *using the shell
 Nate> with the modified ulimits*.

probably you are correct.  however, there is another possibility: the
limitation on the total number of processes allowed by the kernel.

<warning msg="I am not a kernel hacker">

check out the kernel include file include/linux/tasks.h.  (this is
assuming you are running some sort of 2.2.x kernel.)  you will see
two lines like the following:

#define NR_TASKS        2048    /* On x86 Max 4092, or 4090 w/APM configured. */
 
#define MAX_TASKS_PER_USER (NR_TASKS/2)

on my debian potato system, the first line was set to something much
smaller than the value above.  memory may be failing me, but I think
it was initially set to 512.  which would make 
MAX_TASKS_PER_USER == 256.

I ran into this when I had a Java program that was unable to spawn
more than 256 threads.  after increasing NR_TASKS, all was well.  I
also initially suspected ulimit, but found that making everything
unlimited did not solve the problem.  a recompiled kernel with the
above changes did.

finally, I am not sure that the above is the "authorized" way of
increasing the maximum number of processes in a linux kernel.  you
have been warned.  also, I think that 2.4 kernels do not have this
problem at all (or at least, the solution would be different) because
they do not have a fixed size data structure to hold task data.

</warning>

-- 

joe



Reply to: