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 2010/08/06 00:17:59 UTC

DO NOT REPLY [Bug 49713] New: Reverse proxy with MaxKeepAliveRequests=0 consumes memory without bound

https://issues.apache.org/bugzilla/show_bug.cgi?id=49713

           Summary: Reverse proxy with MaxKeepAliveRequests=0 consumes
                    memory without bound
           Product: Apache httpd-2
           Version: 2.2.15
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: mod_proxy
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: adam@m154.homelinux.com


Created an attachment (id=25853)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=25853)
Perl script that functions as a simple backend

Overview: Running Apache 2.2.16 on RHEL 5.5 as a reverse proxy.  When
KeepAlives is on, MaxKeepAliveRequests are 0 and MaxRequestsPerChild is 0, the
memory footprint of the httpd client processes grow without bound.

Steps to Reproduce:
1. Create a simple backend server that just kicks back a 200 OK for all
requests.

2. Change httpd.conf to have:
   KeepAlive On
   MaxKeepAliveRequests 0
   <IfModule prefork.c>
   StartServers       1
   MinSpareServers    1
   MaxSpareServers   1
   MaxClients       1
   MaxRequestsPerChild  0
   </IfModule>
   <IfModule mod_proxy.c>
   ProxyRequests Off

   <Proxy *>
      Order deny,allow
      Allow from all
   </Proxy>
   ProxyPass       /foo http://<ip of backend server>

Start up the server.

3. Flood the proxy server with requests.  I did this with 
   while :; do; wget -i urls.txt -q -O /dev/null; done

Where urls.txt was 1000000 lines of http://localhost/foo.  Run this loop on the
proxy server.

Actual Results: 
Top will show that the vsize and RSS for the 1 httpd process will grow without
bound until the machine runs out of memory.

Expected Results: 

I would expect the memory footprint to remain consistent.

Build Date & Platform: 

Apache 2.2.16 on RHEL 5.5.

Additional Builds and Platforms: 

Also seen on Apache 2.2.3 on RHEL 4.8.

Additional Information: 

A core dump of the httpd process during the run shows that the memory is being
taken up by the repetitive storage of the URI of the backend server over and
over.  After 15 minutes of running, I noted 700,000 strings equal to the ip
address and 2.1 million after 30 minutes.  I will attach the core dump
gathered.  For the backend server, I used the attached perl script to function
as a very simple server.

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


DO NOT REPLY [Bug 49713] Reverse proxy with MaxKeepAliveRequests=0 consumes memory without bound

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=49713

--- Comment #5 from adam@m154.homelinux.com 2010-08-06 15:00:39 EDT ---
My apologies, I should have said MaxRequestsPerChild would work around the
problem, not MaxKeepAliveRequests.

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


DO NOT REPLY [Bug 49713] Reverse proxy with MaxKeepAliveRequests=0 consumes memory without bound

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=49713

--- Comment #6 from Dan Poirier <po...@pobox.com> 2010-08-06 15:19:05 EDT ---
If you set MaxKeepaliveRequests small, do you still see the problem?

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


DO NOT REPLY [Bug 49713] Reverse proxy with MaxKeepAliveRequests=0 consumes memory without bound

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=49713

--- Comment #7 from adam@m154.homelinux.com 2010-08-06 16:12:11 EDT ---
I set MaxKeepAliveRequests to 1 and I still see the problem.  No apparent
impact.

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


DO NOT REPLY [Bug 49713] Reverse proxy with MaxKeepAliveRequests=0 consumes memory without bound

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=49713

--- Comment #1 from adam@m154.homelinux.com 2010-08-05 18:25:19 EDT ---
Created an attachment (id=25854)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=25854)
Core dump

Core dump of the httpd process after running for 2.5 hours.  "strings core.6780
|sort |uniq -c |sort -n" shows 9.4 million occurances of 192.168.1.171 (which
was the ip of my backend server).

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


DO NOT REPLY [Bug 49713] Reverse proxy with MaxKeepAliveRequests=0 consumes memory without bound

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=49713

--- Comment #4 from adam@m154.homelinux.com 2010-08-06 14:41:14 EDT ---
I just now set MaxKeepAliveRequests to 1000000 and I see the same growth in the
process memory footprint.  The difference, of course, is that once it hits
1000000 requests, a new process is started and the memory is thrown away.

After 9 minutes of runtime, the string containing the ip address of my backend
server appeared in a gcore 390,000.

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


DO NOT REPLY [Bug 49713] Reverse proxy with MaxKeepAliveRequests=0 consumes memory without bound

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=49713

James Washer <wa...@us.ibm.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |washer@us.ibm.com

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


DO NOT REPLY [Bug 49713] Reverse proxy with MaxKeepAliveRequests=0 consumes memory without bound

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=49713

--- Comment #3 from Dan Poirier <po...@pobox.com> 2010-08-06 14:05:29 EDT ---
(In reply to comment #2)
> BTW, I do realize that this wouldn't occur if MaxKeepAliveRequests was set to
> non-zero.  This issue would still occur, but it would not be as evident.

Have you confirmed this?

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


DO NOT REPLY [Bug 49713] Reverse proxy with MaxKeepAliveRequests=0 consumes memory without bound

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=49713

--- Comment #2 from adam@m154.homelinux.com 2010-08-05 18:28:57 EDT ---
BTW, I do realize that this wouldn't occur if MaxKeepAliveRequests was set to
non-zero.  This issue would still occur, but it would not be as evident.

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


DO NOT REPLY [Bug 49713] Reverse proxy with MaxKeepAliveRequests=0 consumes memory without bound

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=49713

Joe Orton <jo...@redhat.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|mod_proxy                   |APR
            Version|2.2.15                      |HEAD
         AssignedTo|bugs@httpd.apache.org       |bugs@apr.apache.org
            Product|Apache httpd-2              |APR

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


DO NOT REPLY [Bug 49713] Reverse proxy with MaxKeepAliveRequests=0 consumes memory without bound

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=49713

--- Comment #8 from Ruediger Pluem <rp...@apache.org> 2010-08-09 09:49:48 EDT ---
Can please try the following patch to APR (r983618) and retest?
http://svn.apache.org/viewvc/apr/apr/trunk/network_io/unix/sockets.c?r1=983618&r2=983617&pathrev=983618&view=patch

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


DO NOT REPLY [Bug 49713] Reverse proxy with MaxKeepAliveRequests=0 consumes memory without bound

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=49713

--- Comment #9 from adam@m154.homelinux.com 2010-08-09 11:30:51 EDT ---
With that patch applied the problem does appear to be resolved.  Thanks!

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