13.2.1 Example of Connection Load Balancing for Shared Server Configuration
Figure 13-1 shows an Oracle RAC shared server database with two instances, sales1 and sales2, of the same service, sales.us.example.com. The instances sales1 and sales2 reside on computers sales1-server and sales2-server, respectively. Instance sales1 has one dispatcher and instance sales2 has two dispatchers. Listeners named listener run on nodes 1 and 2. The listener attribute in the DISPATCHERS parameter has been configured to allow for service registration of information to both listeners.
Figure 13-1 Load Balancing Environment for a Shared Server Configuration

Description of "Figure 13-1 Load Balancing Environment for a Shared Server Configuration"
In this example, sales2-server is the least loaded node, sales2 is the least loaded instance, and dispatcher2 is the least loaded dispatcher. The following load information is registered.
-
The one minute load average for each instance is 600 for
sales1and 400 forsales2. This can happen if more processing is required onsales1-server. -
The number of connections to each instance is 200 for
sales1and 300 forsales2. -
The number of dispatcher connections to each instance is 200 for
dispatcher1, 100 fordispatcher2, and 200 fordispatcher3. -
The number of connections to
sales1(200) is the same as that of its only dispatcher,dispatcher1. -
The number of connections on
sales2(300) is the sum of the connections on its two dispatchers,dispatcher2(100) anddispatcher3(200).
The listeners_sales value in (LISTENER=listeners_sales) is resolved through a local tnsnames.ora file on both servers as follows:
listeners_sales=
(DESCRIPTION=
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=tcp)(HOST=sales1-server)(PORT=1521))
(ADDRESS=(PROTOCOL=tcp)(HOST=sales2-server)(PORT=1521))))
Based on the environment, the following actions occur. The numbered actions correspond to the arrows shown in Figure 13-2:
-
LREG processes for instances
sales1andsales2register with both listeners. The listeners are updated dynamically on the load of the instances and dispatchers. -
The client sends a connect request. A connect descriptor is configured to try each protocol address randomly until one succeeds:
sales.us.example.com= (DESCRIPTION= (
LOAD_BALANCE=on) (FAILOVER=on) (ADDRESS=(PROTOCOL=tcp)(HOST=sales1-server)(PORT=1521)) (ADDRESS=(PROTOCOL=tcp)(HOST=sales2-server)(PORT=1521)) (CONNECT_DATA=(SERVICE_NAME=sales.us.example.com)))The listener on
sales1-serverwas randomly chosen to receive the client connect request.The listener on
sales1-servercompares the load of the instancessales1andsales2. The comparison takes into account the load on nodessales1-serverandsales2-server, respectively. Becausesales2-serveris less loaded thansales1-server, the listener selectssales2-serveroversales1-server. -
The listener compares the load on dispatchers
dispatcher2anddispatcher3. Becausedispatcher2is less loaded thandispatcher3, the listener redirects the client connect request todispatcher2. -
The client connects directly to
dispatcher2.
Figure 13-2 Load Balancing Example for a Shared Server Configuration

Description of "Figure 13-2 Load Balancing Example for a Shared Server Configuration"
Parent topic: Understanding Connection Load Balancing