You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Brian Lauber <bl...@cigital.com> on 2012/03/07 23:47:33 UTC

[users@httpd] Load Balancing for REST service

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



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


RE: [users@httpd] Load Balancing for REST service

Posted by Brian Lauber <bl...@cigital.com>.
That did the trick.  Thanks!

 -=- Brian
________________________________________
From: Daniel Ruggeri [DRuggeri@primary.net]
Sent: Thursday, March 08, 2012 6:41 AM
To: users@httpd.apache.org
Subject: Re: [users@httpd] Load Balancing for REST service

On 3/7/2012 8:39 PM, Brian Lauber wrote:
> I was unable to access the presentations that you referenced in your response.  It appears that anonymous users are not authorized to view these files.  If you get the chance, could you please make these presentations available to me?

My mistake. Simple permissions issue - should be fine now.

--
Daniel Ruggeri


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


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


Re: [users@httpd] Load Balancing for REST service

Posted by Daniel Ruggeri <DR...@primary.net>.
On 3/7/2012 8:39 PM, Brian Lauber wrote:
> I was unable to access the presentations that you referenced in your response.  It appears that anonymous users are not authorized to view these files.  If you get the chance, could you please make these presentations available to me?

My mistake. Simple permissions issue - should be fine now.

-- 
Daniel Ruggeri


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


RE: [users@httpd] Load Balancing for REST service

Posted by Brian Lauber <bl...@cigital.com>.
Thanks for the quick response.  I think this will work for at least some of the REST clients, but we do have a handful of clients that do not accept cookies.  In the worst case, I suppose we'll just need to push an update to these clients so that they become cookie-aware.

I was unable to access the presentations that you referenced in your response.  It appears that anonymous users are not authorized to view these files.  If you get the chance, could you please make these presentations available to me?

Thanks!

      -=- Brian


> -----Original Message-----
> From: Daniel Ruggeri [mailto:DRuggeri@primary.net]
> Sent: Wednesday, March 07, 2012 6:59 PM
> To: users@httpd.apache.org
> Subject: Re: [users@httpd] Load Balancing for REST service
> 
> 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%20Pres
> entation.odp
> http://people.apache.org/~druggeri/notes/ApacheConNA%202010%20Pres
> entation.ppt
> 
> --
> Daniel Ruggeri
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org


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


Re: [users@httpd] Load Balancing for REST service

Posted by Daniel Ruggeri <DR...@primary.net>.
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