You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Michael Johnson - MJ <mj...@mediatemple.net> on 2005/05/09 01:22:45 UTC

[users@httpd] RLimitNPROC overly agressive

I just noticed that the RLimitNPROC is overly agressive when checking
the number of  processes forked off for a given user. Take the following
senario for example:

User foo
RLimitNPROC 5 5
The user 'foo' has 4 ssh sessions (or 4 of any process) active.

If the 'foo' has a cgi that does not fork any additional processes, he
can have five concurrent instances of it running as one would expect.

However, if the has a cgi that forks even 1 single process, the
following error is generated in the logs:
    test.sh: fork: Resource temporarily unavailable

If 'foo' has only 3 ssh sessions, one instance of the script runs fine,
but the second will fail when attempting to fork.

Based on the documentation, this should not be happening, but it is in
the newest 1.3 and 2.0 versions of apache. Has any one else ran across
this?

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] RLimitNPROC overly agressive

Posted by André Malo <nd...@perlig.de>.
* Michael Johnson - MJ wrote:

> User foo
> RLimitNPROC 5 5
> The user 'foo' has 4 ssh sessions (or 4 of any process) active.
>
> If the 'foo' has a cgi that does not fork any additional processes, he
> can have five concurrent instances of it running as one would expect.
>
> However, if the has a cgi that forks even 1 single process, the
> following error is generated in the logs:
>     test.sh: fork: Resource temporarily unavailable

That is, how it works; at least on linux. When calling fork() the kernel 
counts the processes that belong to the user and rejects based on this 
number. Other OSes may treat that differently (RLIMIT_NPROC is not 
standardized afaics).

nd
-- 
print "Just Another Perl Hacker";

# André Malo, <http://www.perlig.de/> #

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org