Tuesday, January 23, 2024

COLOCATION_TAG of Client Connections

The COLOCATION_TAG parameter is an alphanumeric string that you can use with the CONNECT_DATA parameter of the TNS connect string.

When you set the colocation_tag within the CONNECT_DATA parameter, load balancing is ignored.

The use of COLOCATION_TAG facilitates the preference for colocating sessions that handle identical data when operating across multiple nodes, mitigating the need for inter-node cache synchronization. Simply assign a character string, potentially carrying business significance, and the load balancer will make an effort to keep together sessions that hash to the same value.

As an illustration, the listener endeavors to direct all clients with the COLOCATION_TAG set to "abcworkload" in the connection descriptor to the same database instance.



pdb_tacservice =
 (DESCRIPTION =
  (CONNECT_TIMEOUT=90)(RETRY_COUNT=50)(RETRY_DELAY=3)(TRANSPRRT_CONNECT_TIMEOUT=3)
   (ADDRESS_LIST=
    (LOAD_BALANCE=ON)
    (ADDRESS = (PROTOCOL = TCP)(HOST= ol8-21-scan.joordsdomain)(PORT=1521))
   )
  (CONNECT_DATA=
    (SERVICE_NAME = pdb_tacservice)
    (COLOCATION_TAG=abcworkload)
   )
 )


Note:Under certain conditions, such as, when maximum load of an instance is reached or when new instances are added or deleted for a service, the colocation of client connections that have the same colocation_tag to the same database instance may not be consistent.





No comments:

Post a Comment