httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 48024] New: mod_sed consumes too much memory when used inside reverse proxy and line sizes are very long e.g. 1-5M
Date Mon, 19 Oct 2009 18:50:00 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=48024

           Summary: mod_sed consumes too much memory when used inside
                    reverse proxy and line sizes are very long e.g. 1-5M
           Product: Apache httpd-2
           Version: 2.3-HEAD
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: basant.kukreja@sun.com


This has been reported to me by Bram <mod_sed@mail.wizbit.be>

When Apache is used as a reverse proxy and mod_sed is used to filter
to content and the output contains lines which are really long e.g
1M-4M chracters in single line, mod_sed consumes too much memory.

Here is the snips of the mail from Bram :
- 1 mb file with only a newline at the end
$ perl -we '$\="\x0D\x0A"; print "a" x (1 * 2 ** 20);' > /var/www/a.1.bin

When the file is downloaded apache uses 70 mb of memory


- 2 mb file with only a newline at the end:
$ perl -we '$\="\x0D\x0A"; print "a" x (2 * 2 ** 20);' > /var/www/a.2.bin

When the file is downloaded apache uses 277 mb of memory


- 3 mb file with only a newline at the end:
$ perl -we '$\="\x0D\x0A"; print "a" x (3 * 2 ** 20);' > /var/www/a.3.bin

When the file is downloaded apache uses 608 mb of memory


- 4 mb file with only a newline at the end:
$ perl -we '$\="\x0D\x0A"; print "a" x (4 * 2 ** 20);' > /var/www/a.2.bin

When the file is downloaded apache uses 1070 mb of memory

------------------------------------------------

I am able to reproduce the issue with following configuration :

LoadModule sed_module modules/mod_sed.so
LoadModule headers_module  modules/mod_headers.so
LoadModule substitute_module  modules/mod_substitute.so
LoadModule proxy_module          modules/mod_proxy.so
LoadModule proxy_http_module     modules/mod_proxy_http.so

ProxyPass / http://hostname:8080/
<Location />
        Header unset Content-Length
        SetOutputFilter Sed
        OutputSed s/\(https:\/\/192.168.173.114\)\//\1:444\//g
</Location>

------------------------------------------------

The above doesn't have any impact if line sizes are small which is the typical
case with html or ascii text.

* Using core category because mod_sed component is not available.

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

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


Mime
View raw message