13.2.2 Example of Connection Load Balancing for Dedicated Server Configuration

Figure 13-3 shows an Oracle RAC dedicated 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. Listeners named listener run on nodes 1 and 2. The REMOTE_LISTENER initialization parameter has been configured to allow for service registration of information to both listeners.

Figure 13-3 Load Balancing Environment for a Dedicated Server Configuration

Description of Figure 13-3 follows
Description of "Figure 13-3 Load Balancing Environment for a Dedicated Server Configuration"

In this example, the following load information is registered:

  • sales1-server has a node load average of 450 per minute.

  • sales2-server has a node load average of 200 per minute.

  • sales1 has 200 connections.

  • sales2 has 150 connections.

The listener_sales1 value in (REMOTE_LISTENER=listener_sales1) is resolved through a local tnsnames.ora file on the sales2-server as follows:

listener_sales1= 
 (DESCRIPTION= 
   (ADDRESS=(PROTOCOL=tcp)(HOST=sales1-server)(PORT=1521)))

The listener_sales2 value in (REMOTE_LISTENER=listener_sales2) is resolved through a local tnsnames.ora file on the sales1-server as follows:

listener_sales2= 
 (DESCRIPTION= 
   (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-4:

  1. LREG processes for instances sales1 and sales2 register with both listeners. The listeners are dynamically updated on the load of the instances.

    Based on the preceding information, sales2-server is the least loaded node and sales2 is the least loaded instance.

  2. 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= 
      (ADDRESS_LIST=
        (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-server was randomly chosen to receive the client connect request.

    The listener on sales1-server compares the load of the instances sales1 and sales2. The comparison takes into account the load on nodes sales1-server and sales2-server, respectively. Because sales2-server is less loaded than sales1-server, the listener selects sales2-server over sales1-server.

  3. The listener on sales1-server redirects the client connect request to the listener on sales2-server.

  4. The client connects to the listener on sale2-server. The listener starts a dedicated server process, and the dedicated server process inherits the connection request from the listener.

Figure 13-4 Load Balancing Example for a Dedicated Server Configuration

Description of Figure 13-4 follows
Description of "Figure 13-4 Load Balancing Example for a Dedicated Server Configuration"