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.
I currently do not understand your problem. Could you reword it and describe it in more detail?
(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?
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)
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.
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.
Hm, this is strange. I do not see this behaviour on my environment. Could you please provide some more details (network sniffs)?
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.
*** This bug has been marked as a duplicate of 38227 ***