httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r1368450 - in /httpd/httpd/branches/2.4.x: ./ CHANGES STATUS modules/proxy/mod_proxy_ajp.c
Date Thu, 02 Aug 2012 13:07:32 GMT
Author: jim
Date: Thu Aug  2 13:07:31 2012
New Revision: 1368450

URL: http://svn.apache.org/viewvc?rev=1368450&view=rev
Log:
Merge r1334343 from trunk:

Use short lived pool to avoid memory leaks

Remove the comment about binding upstream and downstream connections. It
seems to be obsolete since r104604, r104605, r105108.

Also avoid allocating memory if we are not handling the connection.

PR: 52275
Submitted by: Naohiro Ooiwa <naohiro ooiwa miraclelinux com>, Stefan Fritsch

Submitted by: sf
Reviewed/backported by: jim

Modified:
    httpd/httpd/branches/2.4.x/   (props changed)
    httpd/httpd/branches/2.4.x/CHANGES
    httpd/httpd/branches/2.4.x/STATUS
    httpd/httpd/branches/2.4.x/modules/proxy/mod_proxy_ajp.c

Propchange: httpd/httpd/branches/2.4.x/
------------------------------------------------------------------------------
  Merged /httpd/httpd/trunk:r1334343

Modified: httpd/httpd/branches/2.4.x/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/CHANGES?rev=1368450&r1=1368449&r2=1368450&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/CHANGES [utf-8] (original)
+++ httpd/httpd/branches/2.4.x/CHANGES [utf-8] Thu Aug  2 13:07:31 2012
@@ -7,6 +7,9 @@ Changes with Apache 2.4.3
      possible XSS for a site where untrusted users can upload files to
      a location with MultiViews enabled. [Niels Heinen <heinenn google.com>]
 
+  *) mod_proxy_ajp: Reduce memory usage in case of many keep-alive requests on
+     one connection. PR 52275. [Naohiro Ooiwa <naohiro ooiwa miraclelinux com>]
+
   *) mod_proxy_balancer: Restore balancing after a failed worker has
      recovered when using lbmethod_bybusyness.  PR 48735.  [Jeff Trawick]
 

Modified: httpd/httpd/branches/2.4.x/STATUS
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/STATUS?rev=1368450&r1=1368449&r2=1368450&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/STATUS (original)
+++ httpd/httpd/branches/2.4.x/STATUS Thu Aug  2 13:07:31 2012
@@ -99,16 +99,6 @@ PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
      2.4.x patch: Trunk patch applies.
      +1: rjung, sf, jim
 
-   * proxy_ajp: Use short lived pool to avoid memory leaks.
-     Remove the comment about binding upstream and downstream connections. It
-     seems to be obsolete since r104604, r104605, r105108.
-     Also avoid allocating memory if we are not handling the connection.
-     PR 52275, submitted by Naohiro Ooiwa <naohiro ooiwa miraclelinux com>,
-     Stefan Fritsch.
-     trunk patch: http://svn.apache.org/viewvc?view=revision&revision=1334343
-     2.4.x patch: Trunk patch applies.
-     +1: rjung, sf, jim
-
    * headers: ap_str(case)cmp_match returns the opposite of what is advertized
      in the header.
      trunk patch: http://svn.apache.org/viewvc?view=revision&revision=1366319

Modified: httpd/httpd/branches/2.4.x/modules/proxy/mod_proxy_ajp.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/proxy/mod_proxy_ajp.c?rev=1368450&r1=1368449&r2=1368450&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/modules/proxy/mod_proxy_ajp.c (original)
+++ httpd/httpd/branches/2.4.x/modules/proxy/mod_proxy_ajp.c Thu Aug  2 13:07:31 2012
@@ -701,29 +701,15 @@ static int proxy_ajp_handler(request_rec
     int retry;
     proxy_dir_conf *dconf = ap_get_module_config(r->per_dir_config,
                                                  &proxy_module);
-
-    /*
-     * Note: Memory pool allocation.
-     * A downstream keepalive connection is always connected to the existence
-     * (or not) of an upstream keepalive connection. If this is not done then
-     * load balancing against multiple backend servers breaks (one backend
-     * server ends up taking 100% of the load), and the risk is run of
-     * downstream keepalive connections being kept open unnecessarily. This
-     * keeps webservers busy and ties up resources.
-     *
-     * As a result, we allocate all sockets out of the upstream connection
-     * pool, and when we want to reuse a socket, we check first whether the
-     * connection ID of the current upstream connection is the same as that
-     * of the connection when the socket was opened.
-     */
-    apr_pool_t *p = r->connection->pool;
-    apr_uri_t *uri = apr_palloc(r->connection->pool, sizeof(*uri));
-
+    apr_pool_t *p = r->pool;
+    apr_uri_t *uri;
 
     if (strncasecmp(url, "ajp:", 4) != 0) {
         ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(00894) "declining URL %s", url);
         return DECLINED;
     }
+
+    uri = apr_palloc(p, sizeof(*uri));
     ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(00895) "serving URL %s", url);
 
     /* create space for state information */



Mime
View raw message