You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Frans Knibbe <fr...@geodan.nl> on 2006/03/02 14:49:22 UTC

[users@httpd] RlimitNPROC

Hello,

I am trying to use the RLimitNPROC directive to limit the number of CGI 
processes that can run at the same time. To test this, I added the 
directive to httpd.conf like this:

<Directory "C:/Program Files/Apache Group/Apache2/cgi-bin">
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
    RlimitNPROC 4 4
</Directory>

But after restarting the HTTP server, I could easily get more than 4 
executables from the cgi-bin directory to run. How is this possible? Am 
I using the right method to limit the number of specific CGI processes 
that can be spawned by Apache?

I am using Apache 2.0.55 on windows XP.

By the way, I have found a few similar questions to mine on the web, but 
none of them were ever answered, so I assume some other people will be 
interested in this as well.

Regards,

Frans



---------------------------------------------------------------------
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

Posted by Joshua Slive <jo...@slive.ca>.
On 3/2/06, Frans Knibbe <fr...@geodan.nl> wrote:
> Hello,
>
> I am trying to use the RLimitNPROC directive to limit the number of CGI
> processes that can run at the same time. To test this, I added the
> directive to httpd.conf like this:
>
> <Directory "C:/Program Files/Apache Group/Apache2/cgi-bin">
>     AllowOverride None
>     Options None
>     Order allow,deny
>     Allow from all
>     RlimitNPROC 4 4
> </Directory>
>
> But after restarting the HTTP server, I could easily get more than 4
> executables from the cgi-bin directory to run. How is this possible? Am
> I using the right method to limit the number of specific CGI processes
> that can be spawned by Apache?
>
> I am using Apache 2.0.55 on windows XP.
>
> By the way, I have found a few similar questions to mine on the web, but
> none of them were ever answered, so I assume some other people will be
> interested in this as well.

The RLimit* directives set the limits imposed on the CGI scripts
themselves, not on apache.  So your configuration means the CGI script
cannot launch more than 4 processes, but it does not restrict what
apache can do in launching cgi scripts.  To do that, you would need to
change the configuration under which apache itself runs.

If you were on unix, I would suggest mod_load_average:
http://svn.force-elite.com/svn/mod_load_average/trunk/src/mod_load_average.c

On winnt, you could look at some of the third-party modules available
from http://modules.apache.org, but I don't know of anything that can
do specifically what you want.

Joshua.

---------------------------------------------------------------------
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