You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2008/02/04 14:14:10 UTC

DO NOT REPLY [Bug 44351] New: - File descriptor leak when using prg RewriteMap

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=44351>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=44351

           Summary: File descriptor leak when using prg RewriteMap
           Product: Apache httpd-2
           Version: 2.2.8
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P3
         Component: mod_rewrite
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: charles.goyard@orange-ftgroup.com


Hi,

There's a file descriptor leak in httpd under Linux when using mod_rewrite's
RewriteMap with prg (external process).

The first prg gets 3 fds (stdin, stdout, stderr).
The second one gets 5 fds (stdin, stdout, stderr + 2 pipes).
The third one gets 7 fds (stdin, stdout, stderr + 2 pipes + 2 pipes).
and so on.

Apache 2.2 spawns one process per prg.
Apache 2.0 spawns one process per prg and per vhost.

Under 2.0 with 85 vhosts and 6 external prg (my setup) gets thousands of fds,
leading to an out of file descriptor error.
This is highly limited with Apache 2.2 but the bug still exists.

With Linux you can get the fd information under /proc/<pid>/fd/.

Here is how I build Apache and a minimalistic httpd.conf that lets one reproduce
the problem.

./configure --with-mpm=prefork --disable-maintainer-mode --disable-access
--disable-auth --disable-include --disable-autoindex --disable-asis
--disable-cgi --disable-negotiation --disable-dir --disable-imap
--disable-actions --disable-userdir --disable-proxy-ftp --disable-proxy-connect
--disable-setenvif --disable-env --disable-mime --disable-so --disable-alias
--enable-headers --enable-proxy --enable-proxy-http --enable-rewrite
--enable-ssl --enable-status


LockFile    var/httpd.lock
PidFile     var/httpd.pid
User  httpd
Group httpd
Listen *:80

RewriteEngine On
RewriteLock var/lbsync.lock
RewriteMap pool1 prg:/usr/local/lb/lb_1
RewriteMap pool2 prg:/usr/local/lb/lb_2
RewriteMap pool3 prg:/usr/local/lb/lb_3

<VirtualHost *>
        ServerName      www.try1.com
        RewriteEngine On

        RewriteRule . http://${pool1:%{ENV:addr}}/$1
        RewriteOptions  inherit

</VirtualHost>

<VirtualHost *>
        ServerName      www.try2.com
        RewriteEngine On

        RewriteRule . http://${pool2:%{ENV:addr}}/$1
        RewriteOptions  inherit

</VirtualHost>
<VirtualHost *>
        ServerName      www.try3.com
        RewriteEngine On

        RewriteRule . http://${pool3:%{ENV:addr}}/$1
        RewriteOptions  inherit

</VirtualHost>
<VirtualHost *>
        ServerName      www.try4.com
        RewriteEngine On
        RewriteRule . http://${pool1:%{ENV:addr}}/$1
        RewriteOptions  inherit

</VirtualHost>
<VirtualHost *>
        ServerName      www.try5.com
        RewriteRule . http://${pool1:%{ENV:addr}}/$1
        RewriteOptions  inherit

</VirtualHost>

Regards,

Charles

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org