Multiple AZs Read Local Nodes Only
To reduce the access latency of a multi-AZ deployed instance, Tencent Cloud Distributed Cache allows you to read local nodes only. The principle is as follows:
Enable the "read-only replica" feature. Before you enable the feature, confirm that data delay of replicas is allowed.
Enable the "read local nodes only" feature by setting a database parameter.
If there is an available proxy node in the same AZ as the load balancing cluster, the cluster can perceive and access it only.
The proxy node can access the AZ information stored in Redis nodes and route read requests to a Redis node in the same AZ.
Enabling the "read local nodes only" feature
The "read local nodes only" feature is disabled by default. You can enable/disable the feature for an existing instance by setting a database parameter on the Parameter Settings page in the console. Or, you can create a parameter template in which the parameter is specified and apply the template when creating an instance.
2. Above the instance list, select the region.
3. In the instance list, find the target instance.
4. Click the target instance ID to enter the Instance Details page.
5. On the Instance Details page, select the Parameter Settings tab.
6. On the Parameter Settings tab, click the Modifiable Parameters tab, find read-local-node-only in the parameter list, and set it to yes.
Reading local nodes only and read-only routing policy
When read-only replicas are enabled for Tencent Cloud distributed cache database, you can specify a read-only routing policy to control how read requests from an account are distributed between the master node and replica nodes. For more information, see Read-Only Routing Policy. To enable read-only replicas, see Enabling/Disabling Read/Write Separation. After the read local nodes only feature is enabled, it has a higher priority than the read-only routing policy. In this case, nodes in the same AZ will be read first, and then the read-only routing policy will be executed.
Read-only replica is enabled for the instance, and Read-only Routing Policy is set to Replica Node.
The "read local nodes only" feature is enabled (read-local-node-only = yes).
Only one master node exists in the master AZ.
In this case, when the business in the master AZ accesses the proxy node in the master AZ, the proxy will ignore the read-only routing policy and route read requests to the master node in the master AZ to avoid reading across AZs.
Related APIs
|
| Upgrades an instance to support multi-AZ deployment |