Configuring the Delay Threshold and Routing Policy
After read/write splitting is enabled and read replicas are created, you can configure the delay threshold and routing policy as required.
Parameter |
Description |
---|---|
Delay Threshold |
The maximum delay for data to be synchronized from primary DB instances to read replicas. This parameter is only applied when there are read replicas. To prevent data inconsistencies between primary DB instances and read replicas from lasting too long, if 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. When read/write splitting is enabled, the default delay threshold is 30s and the default value range is 0–7,200s. It is recommended that the threshold be greater than or equal to 30s. Traffic is not allocated to read replicas whose delay exceeds the configured threshold. |
Read Weight Distribution |
After read/write splitting is enabled, you can configure read weights for the primary DB instance and read replicas. If no read replicas are selected for the database proxy, read/write splitting cannot be used. The read weight ranges from 1 to 1,000. 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 any read requests (write requests are still automatically routed to the primary DB instance) while the four read replicas process read requests with a ratio of 1:2:5:3. |
Constraints
To enable proxy load balancing, contact customer service.
Configuring Delay Threshold
- Log in to the management console.
- Click in the upper left corner of the page and choose Databases > Relational Database Service.
- On the Instances page, click the target DB instance. The Basic Information page is displayed.
- In the navigation pane on the left, click Database Proxy.
- In the proxy information area, click next to the Delay Threshold field.
Configuring Routing Policy in Multi-Proxy Mode
- Log in to the management console.
- Click in the upper left corner of the page and choose Databases > Relational Database Service.
- On the Instances page, click the primary instance name. The Basic Information page is displayed.
- In the navigation pane on the left, click Database Proxy.
- In the proxy information area, click Configure next to the Routing Policy field. In the displayed dialog box, set required parameters.
- Weighted: You can distribute read weights for the DB instance and read replicas. For details, see Table 1.
The system automatically distributes weights to read replicas, including read replicas created afterwards, according to the default distribution rules. If a read replica breaks down or is deleted, the weight is automatically removed. After the read replica recovers, the weight is automatically restored.
Click OK and view the weights in the proxy information area.
- Load balancing: If selected, to balance the load among read replicas, read requests are automatically distributed to multiple read replicas based on the number of active connections.
In the Select DB Instance drop-down list, select the instances for load balancing.
To add new read replicas for load balancing, select the read replicas from the Select DB Instance drop-down list and click OK.
Click OK and view DB instances for load balancing in the proxy information area.
- Weighted: You can distribute read weights for the DB instance and read replicas. For details, see Table 1.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.