Server affinity

 

Any load-distribution facility, when it chooses a server to direct a request, is not entirely free to select any available server:

  1. In the case of stateful session beans or entity beans within the context of a transaction, there is only one valid server. WebSphere WLM will always direct a client's access of a stateful session bean to the single server instance containing the bean (there is no possibility of choosing the wrong server here). If the request is directed to the wrong server (for example because of a configuration error), it will either fail, or that server itself will be forced to forward the request to the correct server, at great performance cost.

  2. In the case of clustered HTTP sessions or entity beans between transactions, the underlying shared database ensures that any server can correctly process each request. However, accesses to this underlying database may be expensive, and it may be possible to improve performance by caching the database data at the server level. In such a case, if multiple consecutive requests are directed to the same server, they may find the required data still in the cache, and thereby reduce the overhead of access to the underlying database.

The characteristics of each load-distribution facility, which take these constraints into account, are generally referred to as server affinity: In effect, the load distribution facility recognizes that multiple servers may be acceptable targets for a given request, but it also recognizes that each request may have a particular affinity for being directed to a particular server where it may be handled better or faster.

Session affinity is where the load-distribution facility recognizes the existence of a session and attempts to direct all requests within that session to the same server. Transaction affinity is when the load-distribution facility recognizes the existence of a transaction, and behaves similarly.

A particular server affinity mechanism can be weak or strong. In a weak affinity mechanism, the system attempts to enforce the desired affinity for the majority of requests most of the time, but may not always be able to provide a total guarantee that this affinity will be respected. In a strong affinity mechanism, the system guarantees that affinity will always be strictly respected, and generates an error when it cannot.

For more information:

  1. Plug-in workload management and failover
  2. EJB workload management

  Prev | Home | Next

 

WebSphere is a trademark of the IBM Corporation in the United States, other countries, or both.

 

IBM is a trademark of the IBM Corporation in the United States, other countries, or both.