Skip to Main Content

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Tesla.

Asked: January 20, 2017 - 3:21 am UTC

Last updated: November 09, 2021 - 3:52 am UTC

Version: 12.1.0.2

Viewed 1000+ times

You Asked

I have a two node RAC (Oracle 12c) on linux. I have 5 SCAN listeners configured.

Currently, if I do a srvctl config scan I notice that out of the 5 scan listeners, one scan is running in one node and the remaining 4 in the another node.

Is it necessary for me to relocate one or two listeners running on node 2 to node 1?

Will my connections still be load balanced even if I have no scan listeners running in node 1 and all the 5 are running in node 2? If yes, how?

I'm aware on non-availability of a node, cluster will itself relocate the node-VIP to the available node but what does it mean when you run srvctl config scan and you see he output as 1 scan listener is running on Node1 and 4 scan listeners are running on node 2?

Does it mean that node which contains least number of scan listeners is bound to get less requests than the other one?

and Connor said...

No, all we need at least 3 scan's. So in an 10 node RAC, you still would only need 3 scan's. In a 2 node rac, obviously we cant have 3 scans on 3 nodes, so we run 1 scan on 1 node, and 2 (or more) on the other node.

Scan listeners dont do the load balancing - they are there to make client connectivity easier, ie, everything talks to the scan, not each of the nodes.

Load balancing is done by the client, or by the server (depending on configuration).

Rating

  (2 ratings)

Is this answer out of date? If it is, please let us know via a Comment

Comments

More Clarity

Tesla, January 21, 2017 - 5:33 am UTC

1. Is the count of 3 for scan the upper limit? Can't I have 5 scan listeners?
2. scan does not do run time load balancing but it does connection time load balancing in terms of diverting connections to the least loaded node? Correct?
3. You mean to say in a two node RAC, it is totally fine to have one node having 1 scan and the other node having 4 scan's running.? But when do you actually use the srvctl relocate scan?
Connor McDonald
January 22, 2017 - 3:01 am UTC

1. Is the count of 3 for scan the upper limit? Can't I have 5 scan listeners?

3 is the *lower* limit.

2. scan does not do run time load balancing but it does connection time load balancing in terms of diverting connections to the least loaded node? Correct?

For server side load balancing, yes. From the docs:

"With server-side load balancing, the SCAN listener directs a connection request to the best instance currently providing the service by using the load balancing advisory."


3. You mean to say in a two node RAC, it is totally fine to have one node having 1 scan and the other node having 4 scan's running.? But when do you actually use the srvctl relocate scan?

In a n-node cluster, you might want to take a node out of the cluster, which happens to be running a scan. You could relocate to another node.

Database connection load balancing on SCAN LISTENER

A reader, November 03, 2021 - 6:11 am UTC

Greetings!

Application uses RAC service (which is configured to run on both instances of RAC databases). We are seeing the number of sessions /connections are not evenly balanced between the instances.
Some times Node-1 has more number of connections than node-2 and vice-versa.

Questions -

1) Under what circumstances, Oracle scan listener may route DB connection request to the same node in unbalanced manner ?

2) What method application should be looking at , to load balance the database connection in the database when they connect. ?

3) Any specific connection settings will help to achieve the load balance the client connections ?


Thanks!
Connor McDonald
November 09, 2021 - 3:52 am UTC

By default, we load balance on .... well...load :-) The *number* of connections is not really good gauge of this.

The best way to control load balance is via services.

https://docs.oracle.com/en/database/oracle/oracle-database/12.2/racad/workload-management-with-dynamic-database-services.html#GUID-8DC4D5E0-CA9D-47BC-BAD0-8769405AFEC5