Configuring Delay Threshold and Distributing Read Weight
After the read/write splitting function is enabled, you can set the delay threshold and read weight distribution as required.
| Parameter | Description |
|---|---|
| Delay Threshold | Maximum delay for data to be synchronized from primary DB instances to read replicas. To prevent long-time data inconsistency between primary DB instances and read replicas, when the delay of a read replica exceeds the configured threshold, read requests are not forwarded to the read replica regardless of the read weight distributed to it. After read/write splitting is enabled, the default delay threshold is 10 MB and the default value range is 0–10 GB. It is recommended that the threshold be greater than or equal to 10 MB. Traffic is not allocated to read replicas whose delay exceeds the threshold. |
| Read Weight Distribution | After read/write splitting is enabled, the read weight of the primary DB instance is 0 by default. You can modify the read weights distributed to the primary DB instance and read replicas. Read replicas with higher read weight distributions process more read requests. For example, if the read weights distributed to one primary DB instance and four read replicas are 0, 100, 200, 500, and 300, respectively, the primary DB instance does not process read requests (write requests are all automatically forwarded to the primary DB instance) while the four read replicas process read requests with a ratio of 1:2:5:3. The system automatically distributes weights to read replicas, including read replicas created afterwards, according to their specifications based on the distribution rules listed in Distributing Weight. |
Setting Delay Threshold
- Log in to the management console.
- Click
in the upper left corner and select a region and a project. - Click Service List. Under Database, click Relational Database Service. The RDS console is displayed.
- On the Instance Management page, click the target DB instance. The Basic Information page is displayed.
- In the navigation pane on the left, choose Database Proxy. On the displayed page, click the Read/Write Splitting tab.
- In the Read/Write Splitting area, click
in the Delay Threshold area.
Distributing Read Weight
- Log in to the management console.
- Click
in the upper left corner and select a region and a project. - Click Service List. Under Database, click Relational Database Service. The RDS console is displayed.
- On the Instance Management page, click the target DB instance. The Basic Information page is displayed.
- In the navigation pane on the left, choose Database Proxy. On the displayed page, click the Read/Write Splitting tab.
- In the Read Weight Distribution area, click Set Read Weight.
The system automatically distributes weights to read replicas, including read replicas created afterwards, according to the default distribution rules. When the instance breaks down, the weight is automatically removed. After the instance is restored, the weight is automatically restored. After a read replica is deleted, its weight is automatically removed while the weights of other read replicas remain unchanged.
Last Article: Enabling Read/Write Splitting
Next Article: Disabling Read/Write Splitting
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.