Monday, February 13, 2012

Load Balancing in 11g R2 with SCAN (LBSCORE).


LBSCORE:

Attended session from Oracle Support for Load Balancing in 11G R2. Here trying to spread what I  have learnt.

As of now we have SCAN ( Single client access name). Two are the parameter that is most important to play role in load balancing.

LOCAL_LISTENER i.e. set to local VIP
REMORE_LISTENER i.e. set to SCAN VIP. (it is set by default).

Something like this:

Node A:

LOCAL_LISTENER=LISTENER_A
REMOTE_LISTENER=LISTENER_B

On Node B:

LOCAL_LISTENER=LISTENER_B
REMOTE_LISTENER=LISTENER_A

So for load balancing SCAN LISTENER has to aware of server load. As we know scan listener is remote listener, and job of scan listener is to forward connection to local listener running on each node.

When we start the two instances the corresponding PMON processes get dynamically registered with both the listeners and start feeding listeners with load profile information. PMON gathers load information using kstat() unix system call. When a new incoming connection hits any of the listener process, it will redirect the connection to the least loaded node. Scan listener calculates least loaded node by calculating lbscore against each RAC database instance.

The calculation of lbscore at each listener is as follows:
After instance restart,
Listener lbscore = goodness value updated by PMON
Listener Delta = delta value updated by PMON
After every incoming connection Listener lbscore becomes,
New Listener lbscore = Current Listener lbscore + Listener Delta
After every SMON update, Listener’s lbscore and delta are reset to values supplied by SMON.


Monitoring Load Balancing effectiveness:

The load balancing effectiveness can be monitored by tracking updates in listener log files, detailed explanation is provided in metalink note 263599.1. The note has an interesting discussion on how to calculate effectiveness of client side load balancing (a.k.a TNS load balancing) based on the listener log file contents.

No comments:

Post a Comment