in reply to BSD::Resource and RLIMIT_NPROC on Linux

RLIMIT_NPROC controls the total number of processes that uid can have running at once. So for example if you're doing this as the Apache user and you already have 100 processes running, setting a limit of 100 will stop you from creating any new processes.

At least, that's how it's supposed to work.

Replies are listed 'Best First'.
Re^2: BSD::Resource and RLIMIT_NPROC on Linux
by dgaramond2 (Monk) on Apr 02, 2006 at 04:50 UTC
    OK, got it. So the total number of processes is counted for all existing processes, not just the new/child processes. My test script failed because even when I set $soft and $hard to 100, I have already more than 100 processes lying around at that time, so I cannot make new processes. And when I set $soft larger than $hard (e.g. $soft=2 and $hard=1), the behaviour becomes... well, let's say undefined, since it's not described in the manpages.