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 2007/09/05 08:27:46 UTC

DO NOT REPLY [Bug 43308] New: - Persistent backend connections not supported for RewriteRule [P]

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=43308>.
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=43308

           Summary: Persistent backend connections not supported for
                    RewriteRule [P]
           Product: Apache httpd-2
           Version: 2.2.4
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P3
         Component: mod_proxy
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: asmorgrav@yahoo.no


In Apache 2.2.x a worker, and the associated backend connection pool, is created
for each ProxyPass directive. In that case the backend connections will by
default be persistent (reusable).

Another mechanism exists for proxying requests to a backend: RewriteRule with
the [P] flag. Unless the URL resulting from the rewriting process matches an
existing worker (created because of the presence of a RewriteRule), the
rewritten request will not be able to benefit from a persistent connection to
the backend. In that case the default worker (*) will be used. The connections
in the pool of the default worker are not persistent.

I therefore suggest to modify ap_proxy_pre_request() in order to create new
workers as needed in the event of requests that do not match an existing worker.

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


DO NOT REPLY [Bug 43308] - Persistent backend connections not supported for RewriteRule [P]

Posted by bu...@apache.org.
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=43308>.
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=43308





------- Additional Comments From asmorgrav@yahoo.no  2007-09-05 01:20 -------
Created an attachment (id=20772)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=20772&action=view)
Configuration and debug log illustrating the creation of new workers

The attached file contains the debug log tracing a few requests made against a
patched server.

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


DO NOT REPLY [Bug 43308] - Persistent backend connections not supported for RewriteRule [P]

Posted by bu...@apache.org.
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=43308>.
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=43308


Bug 43308 depends on bug 43472, which changed state.

Bug 43472 Summary: New version socket_is_connected breaks http keep-alive connections
http://issues.apache.org/bugzilla/show_bug.cgi?id=43472

           What    |Old Value                   |New Value
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED



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


DO NOT REPLY [Bug 43308] - Persistent backend connections not supported for RewriteRule [P]

Posted by bu...@apache.org.
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=43308>.
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=43308


serai@lans-tv.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |serai@lans-tv.com




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


DO NOT REPLY [Bug 43308] - Persistent backend connections not supported for RewriteRule [P]

Posted by bu...@apache.org.
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=43308>.
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=43308





------- Additional Comments From asmorgrav@yahoo.no  2007-10-01 10:26 -------
(In reply to comment #8)
> I've read mod_proxy.c and proxy_util.c and found a hackful workaround.
> Using ProxyPass to create dummy workers.
> Rewriting applied, then uses the dummy ProxyPass's worker.

Yes indeed, but it supposes that you code the exhaustive list of workers into
the configuration. If your backend server list is in a RewriteMap where you can
add and delete workers without restarting Apache, or if you use any other means
to maintain the list of backend servers, this approach does not work.

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


DO NOT REPLY [Bug 43308] - Persistent backend connections not supported for RewriteRule [P]

Posted by bu...@apache.org.
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=43308>.
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=43308


asmorgrav@yahoo.no changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #20771|0                           |1
        is obsolete|                            |




------- Additional Comments From asmorgrav@yahoo.no  2007-09-13 01:54 -------
Created an attachment (id=20808)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=20808&action=view)
Patch in Unified format

Here's the same patch again, this time in diff -u format

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


DO NOT REPLY [Bug 43308] - Persistent backend connections not supported for RewriteRule [P]

Posted by bu...@apache.org.
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=43308>.
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=43308





------- Additional Comments From chip@force-elite.com  2007-09-10 18:52 -------
Can you provide the patch in 'diff -u' format?

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


DO NOT REPLY [Bug 43308] - Persistent backend connections not supported for RewriteRule [P]

Posted by bu...@apache.org.
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=43308>.
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=43308


asmorgrav@yahoo.no changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #20808|0                           |1
        is obsolete|                            |




------- Additional Comments From asmorgrav@yahoo.no  2007-09-17 02:09 -------
Created an attachment (id=20830)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=20830&action=view)
Patch against httpd 2.2.4

In addition to creating workers implicitly, this new patch implements a new
configuration directive ProxyMaxAddtlWorkers which defaults to 0. This
directive limits the number of workers that can be implicitly created during
request processing and an equivalent number of additional scoreboard entries
are allocated at startup.

Another advantage over the previous patch is that the newly created worker is
used immediately - no need to wait for the next request.

The macro PROXY_COPY_CONF_PARAMS has been moved from mod_proxy.c to mod_proxy.h
because it is also used in proxy_util.c.

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


DO NOT REPLY [Bug 43308] - Persistent backend connections not supported for RewriteRule [P]

Posted by bu...@apache.org.
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=43308>.
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=43308





------- Additional Comments From asmorgrav@yahoo.no  2007-09-04 23:34 -------
Created an attachment (id=20771)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=20771&action=view)
Patch against httpd 2.2.4

The attached patch adds new workers on the fly as new backends for which no
worker exists are identified. This can happen if a RewriteRule proxies a
request (with the [P] flag), and the backend URL does not match any of the
ProxyPass' second argument (URL).

1. New workers are created for scheme://address/. The URL path is ignored. One
might want to add a new configuration directive for specifying the number of
path elements to include in the worker name.

2. The request for which the worker is created is served using the default
worker. The connection pool for the new worker is then only populated on the
first request matching the new worker (the 2nd request), and an existing
connection may only be reused from the following request on.

3. There is no way to tune the connection pooling of the workers created
on-the-fly.

4. One might want to add a new configuration directive for (de-)activating this
mechanism


Regarding the implementation details, being a novice to Apache development, I
look forward to your comments. However

i) PROXY_COPY_CONF_PARAMS should probably be moved to mod_proxy.h to avoid
duplication of code

ii) I allocate a copy of the URL on the stack rather than out of the pool since
as far as I could see, it is duplicated in ap_proxy_add_worker() anyway

iii) Someone skilled in the art of Apache httpd development could probably come
up with a way that the newly created worker could be used immediately instead
of having to wait for the next request.


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


DO NOT REPLY [Bug 43308] - Persistent backend connections not supported for RewriteRule [P]

Posted by bu...@apache.org.
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=43308>.
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=43308


serai@lans-tv.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|2.2.4                       |2.2.6




------- Additional Comments From serai@lans-tv.com  2007-09-28 23:45 -------
I've read mod_proxy.c and proxy_util.c and found a hackful workaround.
Using ProxyPass to create dummy workers.
Rewriting applied, then uses the dummy ProxyPass's worker.

-----example-----

my server conf:
RewriteEngine On
RewriteRule ^/([^.]+)\.php$ http://localhost:20000/test/$1.php [P]
ProxyPassReverse / http://localhost:20000/test/

added:
ProxyPass /keepalive-dummy/ http://localhost:20000/


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


DO NOT REPLY [Bug 43308] - Persistent backend connections not supported for RewriteRule [P]

Posted by bu...@apache.org.
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=43308>.
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=43308


serai@lans-tv.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  BugsThisDependsOn|                            |43472




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


DO NOT REPLY [Bug 43308] - Persistent backend connections not supported for RewriteRule [P]

Posted by bu...@apache.org.
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=43308>.
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=43308


asmorgrav@yahoo.no changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #20830|0                           |1
        is obsolete|                            |




------- Additional Comments From asmorgrav@yahoo.no  2007-09-17 02:29 -------
Created an attachment (id=20831)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=20831&action=view)
Patch against 

The scoreboard entries are not really allocated, but proxy_lb_workers is
incremented by the value of ProxyMaxAddtlWorkers.

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


DO NOT REPLY [Bug 43308] - Persistent backend connections not supported for RewriteRule [P]

Posted by bu...@apache.org.
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=43308>.
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=43308


asmorgrav@yahoo.no changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |PatchAvailable




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


DO NOT REPLY [Bug 43308] - Persistent backend connections not supported for RewriteRule [P]

Posted by bu...@apache.org.
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=43308>.
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=43308





------- Additional Comments From asmorgrav@yahoo.no  2007-09-16 23:52 -------
In order to address certain concerns about possible DoS attacks or potential
resource consumption, rather than a configuration directive for de-activating
this mechanism, I suggest adding a new configuration directive ProxyMaxAddtlWorkers.

It will take a single numeric argument which is the maximum number of workers
that can be implicitly created. The default value would be 0 - zero -
effectively disabling the creation of additional workers.

Apart from limiting the number of workers created by the above described
mechanism, an equivalent number of additional scoreboard entries should also be
allocated during the configuration phase in order to avoid starving client
connections.

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