Why are calls between clustered session beans not load balanced even though load balancing policy is Round Robin?
Let’s say that we have two session beans, A and B. A is not a clustered bean and is deployed in server 1 and B is a clustered bean deployed in servers 1 and 2. Using Round-Robin as load balancing policy, you might expect calls from bean A to bean B to be load balanced between servers 1 and 2. Actually, this is not what will happen. Repeated calls from bean A to bean B will always remain in server 1. In JBoss, the default policy is to invoke locally for clustered ejbs. This avoids the need for distributed transactions and serialisation, thus reducing the complexity of the call and increasing the performace. There’s various alternatives in order to avoid this situation. First one, remove session bean A from server 1 and deploy it in a new server, let’s say server 3. Calls from bean A to bean B will then be load balanced between servers 1 and 2. Another alternative would be to write your own interceptor and modify the EJB stack(only available from JBoss 4.0.2).
Related Questions
- In the configuration for session failover, whats the relationship among the policy agents, the Load Balancer, and the Access Manager servers behind Load Balancers?
- What is the policy for Work Load Management and stateful session beans?
- Does Agora work in a clustered (i.e. load balanced) Sakai environment?