File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes what is server affinity? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "what is server affinity?" Watch "what is server affinity?" New topic

what is server affinity?

bird cao
Ranch Hand

Joined: Feb 14, 2004
Posts: 43
what is server affinity
bird cao
Ranch Hand

Joined: Feb 14, 2004
Posts: 43
another one: how to make Hardware load balancing?
Rufus BugleWeed
Ranch Hand

Joined: Feb 22, 2002
Posts: 1551
server affinity is maching a client to the server processing the client's requests in a horizontally scaled arch.
load balancing is distributing requests to said servers so they process load in accordance to their capacity.
zheng shu

Joined: Jan 12, 2004
Posts: 12
Originally posted by bird cao:
what is server affinity

Server affinity refers to the capacity that a server in a cluster
is able to service requests from the same HTTP client during its
entire session. This is important if the process is stateful.
The load balancer usually adds its own Cookie to each request
it dispatchers to the server since it gets the first request
from the client. The cookie is pushed back to the client with
the first response. Thereafter, the client requests carry this
cookie (taht identifies the server that services the first response)
to the load balancer so that load balancer knows which server it
should dispatcher the follwing requests.
You buy a hardware load balancer and put it infront of your HTTP
Load-balancer, DMZ, firewall, or clustering, is not defined in
J2EE framework, so I guess it is not that important to know
everything in details. They are basically part of infrastructure.
Cheers Prasad

Joined: Feb 11, 2002
Posts: 23
In simple sentences, in clustered environment, dispatching(by load balancer) of 1+.. request to same server where HTTPSession info for the client is stored in the memory called is Server Affinity.
Server Affinity is required for stateful session bean.
In clustered environment HTTPSession management taken care by storing session in database where any server clone can get any httpsession info for any client from database which avoids server affinity.
For stateful session bean even after HTTPSession being stored in database,server affinity is required because instance of Stateful session bean is stored in the particular server where first instance is created.
I agree. Here's the link:
subject: what is server affinity?
It's not a secret anymore!