Bug 157554 - www/apache22: Apache RLimitNPROC does not work as intended because Kernel counts process differently
Summary: www/apache22: Apache RLimitNPROC does not work as intended because Kernel cou...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-apache (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-03 10:10 UTC by Patrick Proniewski
Modified: 2016-09-17 19:41 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Proniewski 2011-06-03 10:10:09 UTC
Apache directive RLimitNPROC allows for process limiting.  According to
documentation (http://httpd.apache.org/docs/current/mod/core.html#rlimitnproc ),
it's supposed to limit the number of processes forked by Apache children:
"This applies to processes forked off from Apache children servicing
requests, not the Apache children themselves".

On FreeBSD, Apache Children are taken into account by the kernel when
enforcing RLimitNPROC.  So, for example, it's impossible to run a single
CGI that fork the uname command if RLimitNPROC is set to 10 and if you
have 9 or more httpd processes.

It yields to error logs in messages:

kernel: maxproc limit exceeded by uid 80, please see tuning(7) and login.conf(5).

And it renders the whole concept of RLimitNPROC useless (for Apache)

How-To-Repeat: - install Apache 2.2 on FreeBSD 8.2
- setup Apache with following values:
     StartServers 5
     RLimitNPROC 5
- create a simple CGI script that queries a system command (uname, ls...)
- make a GET request to that CGI
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2011-06-09 22:32:44 UTC
Responsible Changed
From-To: freebsd-bugs->apache

AFAICT this is a bug with the port, not the kernel.
Comment 2 Martin Wilke freebsd_committer freebsd_triage 2014-02-27 15:09:09 UTC
State Changed
From-To: open->feedback

still a problem?