[ale] Limiting Processes

Chris Ricker kaboom at gatech.edu
Tue Dec 4 10:21:32 EST 2001


On Tue, 4 Dec 2001, Chris Fowler wrote:

> Is there a way in 2.4.X to limit the total number of processes that can be
> ran on one system?  I know in 2.2.X I just edited task.h and made a change.

On 2.4 the hard limit is based off of memory.  See kernel/fork.c and look at 
fork_init():

        max_threads = mempages / (THREAD_SIZE/PAGE_SIZE) / 8;

        init_task.rlim[RLIMIT_NPROC].rlim_cur = max_threads/2;
        init_task.rlim[RLIMIT_NPROC].rlim_max = max_threads/2;


(remember, in Linux, a process == thread)

There's also a sysctl for this, or the /proc/sys/kernel/threads-max file 
where you can dynamically modify the limit.

later,
chris


---
This message has been sent through the ALE general discussion list.
See http://www.ale.org/mailing-lists.shtml for more info. Problems should be 
sent to listmaster at ale dot org.






More information about the Ale mailing list