Thursday, 6 June 2019

Configure server-side Load Balancing Advisory for connect-time load balancing

 Configure server-side Load Balancing Advisory for connect-time load balancing


  • Testing server-side connect-time load balancing when LBA is not enabled 
[oracle@srv1 ~]$ srvctl add service -database rac -service lbsrv -preferred rac1,rac2 
[oracle@srv1 ~]$ srvctl start service -database rac -service lbsrv
[oracle@srv1 ~]$ srvctl config service -d rac -s lbsrv
Service name: lbsrv
Server pool:
Cardinality: 2
Disconnect: false
Service role: PRIMARY
Management policy: AUTOMATIC
DTP transaction: false
AQ HA notifications: false
Global: false
Commit Outcome: false
Failover type:
Failover method:
TAF failover retries:
TAF failover delay:
Connection Load Balancing Goal: LONG
Runtime Load Balancing Goal: NONE
TAF policy specification: NONE
Edition:
Pluggable database name:
Maximum lag time: ANY
SQL Translation Profile:
Retention: 86400 seconds
Replay Initiation Time: 300 seconds
Session State Consistency:
GSM Flags: 0
Service is enabled
Preferred instances: rac1,rac2
Available instances:
[oracle@srv1 ~]$


[root@srv1 ~]# lsnrctl service | grep lbsrv
Service "lbsrv" has 1 instance(s).

When the GOAL is NONE, it means the LBA is not enabled for the service.

SQL> col name format a20
SQL> SELECT NAME, GOAL, CLB_GOAL FROM DBA_SERVICES WHERE NAME='lbsrv';

NAME                 GOAL         CLB_G
-------------------- ------------ -----
lbsrv                NONE         LONG

SQL>

SQL> SELECT INST_ID, COUNT(*) FROM   GV$SESSION GROUP BY INST_ID ORDER BY INST_ID;

   INST_ID   COUNT(*)
---------- ----------
         1         56
         2         57

SQL>

TNSNAMES.ORA

lbsrv =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.56.91)(PORT = 1531))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = lbsrv)
    )
  )

  • Testing server-side connect-time load balancing when LBA is enabled 


 modify the lbrsrv service so that the LBA is enabled


[root@srv1 ~]# srvctl modify service -db rac -service lbsrv -rlbgoal service_time -clbgoal short

[root@srv1 ~]# crsctl status resource -t


ora.rac.db
      1        ONLINE  ONLINE       srv1                     Open,STABLE
      2        ONLINE  ONLINE       srv2                     Open,STABLE
ora.rac.lbsrv.svc
      1        ONLINE  ONLINE       srv1                     STABLE
      2        ONLINE  ONLINE       srv2                     STABLE


SQL> col name format a20
SQL> SELECT NAME, GOAL, CLB_GOAL FROM DBA_SERVICES WHERE NAME='lbsrv';

NAME                 GOAL         CLB_G
-------------------- ------------ -----
lbsrv                SERVICE_TIME SHORT
  • srvctl stop service -database rac -service lbsrv 
  • srvctl remove service -database rac -service lbsrv 

• To enable LBA in a service, set service-level goals for run-time connection load balancing (rlbgoal): SERVICE_TIME: work requests distributed based on response time
THROUGHPUT: work requests distributed based on throughput
• If rlbgoalis not configured (or set to NONE), the LBA  is disabled

No comments:

Post a Comment