Problem:
- Product Name: VisiBroker for C and Java
- Product Version: All
- Platform/OS Version: All
As documented in VisiBroker Developer's Guide, the Smart Agent implements load balancing using a simple round-robin algorithm on a per agent basis, not on an ORB domain basis. For load balancing between server replicas, when there is more than one Smart Agent in the ORB domain, the guideline suggests to ensure all servers are registered with the same Smart Agent.
However on deployment scenarios when servers and their replica are registered to different Smart Agents, what is the behavior of osagent's load balancing and round robin?
Resolution:
In order to illustrate the behavior, the following test cases are summarized and briefly described. Service B is a replica of Service A. In case the same Client process has to do a bind(), the vbroker.orb.cacheDSQuery property has to be set to false.
Since the Service A and Service B are running in separate subnets, both have to set the environment variable OSAGENT_ADDR_FILE or the property vbroker.agent.addrFile=<addrFile>. Inside the addrFile, it should list the IP addresses of osagent A and osagent B. For example below:
#[For Service A]
#list first the osagent A's IP address
aaa.bbb.ccc.ddd
aaa.xxx.yyy.zzz
#[For Service B]
#list first the osagent B's IP address
aaa.xxx.yyy.zzz
aaa.bbb.ccc.ddd
Test Case #1:
Setup:
- Service A runs aaa.bbb.ccc.ddd and registers to osagent A.
- Service B runs aaa.xxx.yyy.zzz and registers to osagent B.
- 3 Clients runs same subnet with aaa.bbb.ccc.ddd or the vbroker.agent.addr property (on client) is set to aaa.bbb.ccc.ddd.
Result: All 3 clients query the osagent A and receives IOR of Service A always.
Test Case #2:
Setup:
- Service A runs aaa.bbb.ccc.ddd and registers to osagent A.
- Service B runs aaa.xxx.yyy.zzz and registers to osagent B.
- 3 Clients runs same subnet with aaa.xxx.yyy.zzz or the vbroker.agent.addr property (on client) is set to aaa.xxx.yyy.zzz.
Result: All 3 clients query the osagent B and receives IOR of Service B always.
Test Case #3:
Setup:
- Service A runs aaa.bbb.ccc.ddd and registers to osagent A.
- Service B runs aaa.xxx.yyy.zzz and registers to osagent B.
- osagent B is intentionally and gracefully shutdown. Service B is now known to osagent A.
- 3 Clients runs same subnet with aaa.bbb.ccc.ddd.
Result: All 3 clients query the osagent A and receives IORs of Service A and B alternately for each client bind. Even when osagent B is started, osagent A will continue to hold Service B. Load balancing through round robin will continue when clients query osagent A; for example, all 3 clients will still receive IORs of Service A and B alternately for each client bind, in round robin fashion.
#osagent
#round-robin
#Security
#loadbalancing
#VisiBroker