This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes Load Balancer Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "Load Balancer" Watch "Load Balancer" New topic
Author

Load Balancer

Luke Murphy
Ranch Hand

Joined: May 12, 2010
Posts: 300
In a lot of deployments there are two HTTP servers to prevent from there being a single point of failuer.
A load balancer then usually sits in front of the two HTTP servers.

Suppose I want session affinity and round robin. Do I configure this in my load balanacer or do I just configure the load balancer to forward to one http server and put the session affinity and round robin there. The other HTTP server would only kick in then if the primary one fails?
Rishi Shehrawat
Ranch Hand

Joined: Aug 11, 2010
Posts: 218

Session affinity can be configured at the load balancer. However if you are using a pure HTTP server like Apache, then session affinity will need to be configured at the HTTP server as the HTTP server will be forwarding the request to the web container.
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6661
    
    5

Suppose I want session affinity and round robin.


Affinity and round robin are mutually exclusive.


SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
Arnold Reuser
Ranch Hand

Joined: Nov 20, 2003
Posts: 194
Deepak Bala wrote:
Suppose I want session affinity and round robin.

Affinity and round robin are mutually exclusive.


That depends on the flexibility of your load balancer.
Your can differ between the algorithms used based on the headers of the http request.
As such affinity and round robin are not mutually exclusive
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6661
    
    5

Arnold Reuser wrote:
Deepak Bala wrote:
Suppose I want session affinity and round robin.

Affinity and round robin are mutually exclusive.


That depends on the flexibility of your load balancer.
Your can differ between the algorithms used based on the headers of the http request.
As such affinity and round robin are not mutually exclusive


They are.

What you are talking about is switching the load balancer's mode of operation between affinity and RR. I agree that this can be configured. However you cannot serve a request in affinity mode and then decide that you want to serve it in RR next time. Practically, it would not make sense
Arnold Reuser
Ranch Hand

Joined: Nov 20, 2003
Posts: 194
It would indeed make no sense to switch from affinity to RR mode.
Switching from RR to affinity would make sense and is also of practical use.
But, based on your remark, I think that was not the question asked.

Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6661
    
    5

Arnold Reuser wrote:It would indeed make no sense to switch from affinity to RR mode.
Switching from RR to affinity would make sense and is also of practical use.
But, based on your remark, I think that was not the question asked.



Yes we are discussing 2 different points. I perceived the 'and' in the initial question to mean configuring both at the same time

Suppose I want session affinity and round robin
Luke Murphy
Ranch Hand

Joined: May 12, 2010
Posts: 300
They are not mutually exclusive.

You can configure round robin and session affinity in Apache HTTP Server.

Basically, every new client follows round robin, until they hit a server. Every existing client "sticks" to the server they are on.
This approach is also called sticky round robin...
http://download.oracle.com/docs/cd/E19823-01/819-0215/loadb.html#wp1027015

Cheers.
 
Consider Paul's rocket mass heater.
 
subject: Load Balancer
 
Similar Threads
Load Balancer
DNS Round Robin
Performance Issues with HTTP Server Plug-in?
WebSphere 4.0.1 AE load balancing
How to route requests to a managed server