httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Ruggeri <DRugg...@primary.net>
Subject Re: [users@httpd] Load Balancing for REST service
Date Wed, 07 Mar 2012 23:59:18 GMT
On 3/7/2012 4:47 PM, Brian Lauber wrote:
> Howdy.
>
> We have a REST service that we are attempting to load balance via mod_proxy_balancer.
 Unfortunately, we have been unable to figure out how to maintain the session stickiness across
REST service calls.  In particular, our REST service does not make use of cookies or URL query
parameters, which are the traditional means for communicating session-related information.
>
> Ideally, we would like to maintain the session stickiness based upon the client's IP
address; however, we're open to other suggestions as well (including using a different load
balancing plugin).  Our main goal is to figure out how to load balance the REST service in
a manner that will be transparent to the existing REST clients.
>
> Any suggestions would be appreciated.  Thanks in advance!
>
>      -=- Brian
>

Brian;
   Here is a simple snippet that will use mod_headers as well as
mod_proxy_balancer to implement a cookie-based solution. In my
experiences, this works across many different types of clients (so long
as they accept cookies) and all types of backend services.

LoadModule headers_module modules/mod_headers.so
<Proxy balancer://DanielCluster>
   BalancerMember http://1.2.3.4:8009 route=mercury
   BalancerMember http://1.2.3.5:8009 route=venus
   ProxySet stickysession=DanielsApp_STICKY
</Proxy>
Header add Set-Cookie
"DanielsApp_STICKY=sticky.%{BALANCER_WORKER_ROUTE}e;path=/;"
env=BALANCER_ROUTE_CHANGED

ProxyPass /daniel/ balancer://DanielCluster/daniel/


For reference (and other proxy examples), I pulled this straight from a
presentation I gave at ACNA2010 here:
http://people.apache.org/~druggeri/notes/ApacheConNA%202010%20Presentation.odp
http://people.apache.org/~druggeri/notes/ApacheConNA%202010%20Presentation.ppt

-- 
Daniel Ruggeri


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message