Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

what is server affinity?

 
bird cao
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is server affinity
 
bird cao
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
another one: how to make Hardware load balancing?
 
Rufus BugleWeed
Ranch Hand
Posts: 1551
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
HTH
 
zheng shu
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
server.
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
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
Cheers,
Prasad
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic