Bug 39267 - mod_proxy_balancer does not work with connection keepalive
Summary: mod_proxy_balancer does not work with connection keepalive
Status: RESOLVED DUPLICATE of bug 38227
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_proxy_balancer (show other bugs)
Version: 2.5-HEAD
Hardware: All other
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-04-11 06:43 UTC by Mao Morimoto
Modified: 2006-04-22 08:27 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mao Morimoto 2006-04-11 06:43:27 UTC
mod_proxy of Apache 2.3 works well with connection pool and keepalive, but 
mod_proxy_balance does not works so well. Connections once used are pooled, but 
used only once, not reused.
Comment 1 Ruediger Pluem 2006-04-11 22:19:17 UTC
I currently do not understand your problem. Could you reword it and describe it
in more detail?
Comment 2 James A. Robinson 2006-04-12 00:25:34 UTC
(In reply to comment #0)
> mod_proxy of Apache 2.3 works well with connection pool and keepalive, but 
> mod_proxy_balance does not works so well. Connections once used are pooled, but 
> used only once, not reused.


Is there any chance you're seeing the same thing I discuss
on http://issues.apache.org/bugzilla/show_bug.cgi?id=38227 ?

Specifically, where I find that the worker's 'hmax' setting
does not seem to be set by default on the balancer, thereby
causing the code to always allocate new connections?
Comment 3 Mao Morimoto 2006-04-12 02:50:39 UTC
Following is the simple example. There are only 1 client, 1 proxy, 1 backend 
and 1 connection, to easy to understand.
Example1 is the behavior of mod_proxy. It works perfectly with keepalive and 
connection pool.
Example2 is the most simple behavior of mod_proxy_balancer with only 1 backend 
server. It does not reuse the connection however it can be reusable.

################ Example1 ################
## conf
ProxyRequests Off
ProxyPass / http://backend/ min=1 max=1

## tcp packets (ACK packets are omitted)
client =====syn=====> proxy
client =====GET1====> proxy
                      proxy =====syn=====> backend
                      proxy =====GET1====> backend
                      proxy <=====RES1==== backend
client <=====RES1==== proxy
client =====GET2====> proxy
                      proxy =====GET2====> backend
                      proxy <=====RES2==== backend
client <=====RES2==== proxy
                        :
client <=====fin===== proxy (keepalive timeout)
                        :
                      proxy <=====fin===== backend (keepalive timeout)


################ Example2 ################
## conf
<Proxy balancer://cluster/>
    BalancerMember http://backend min=1 max=1
</Proxy>
ProxyPass / balancer://cluster/

## tcp packets (ACK packets are omitted)
client =====syn=====> proxy
client =====GET1====> proxy
                      proxy =====syn=====> backend
                      proxy =====GET1====> backend
                      proxy <=====RES1==== backend
client <=====RES1==== proxy
client =====GET2====> proxy
                      proxy =====fin=====> backend
                      proxy =====syn=====> backend
                      proxy =====GET2====> backend
                      proxy <=====RES2==== backend
client <=====RES2==== proxy
                        :
client <=====fin===== proxy (keepalive timeout)
                        :
                      proxy <=====fin===== backend (keepalive timeout)
Comment 4 Ruediger Pluem 2006-04-14 12:39:29 UTC
It seems that you are affected by what has been described in comment #14 and #15
 of PR38227. Please apply
http://issues.apache.org/bugzilla/attachment.cgi?id=18055 and your problem
should be solved.
Comment 5 Mao Morimoto 2006-04-19 02:59:21 UTC
Thank you. The latest version httpd_20060418221939 works almost well.
But I noticed, the first connection to backend server is discarded immediately. 
It's not so serious problem, but I think it's not correct.
Comment 6 Ruediger Pluem 2006-04-19 21:02:31 UTC
Hm, this is strange. I do not see this behaviour on my environment. Could you
please provide some more details (network sniffs)?
Comment 7 Mao Morimoto 2006-04-20 00:47:46 UTC
Sorry. I had misunderstood it. The client uses 2 sessions to the proxy, the 
second session from client to proxy was processed by other child process of 
Apache, and so I misunderstood it that the connection does not be reused.
Comment 8 Ruediger Pluem 2006-04-22 15:27:27 UTC

*** This bug has been marked as a duplicate of 38227 ***