This topic describes how to modify the latency threshold and read weights when read/write splitting is enabled.

For more information, see Table 1.

Procedure

  1. Log on to the RDS console.
  2. In the upper-left corner, select the region where the target RDS instance is located.
    选择地域
  3. Find target RDS instance and click the instance ID.
  4. In the left-side navigation pane, click Database Connection or Database Proxy.
  5. Click the Read/Write Splitting tab.
  6. In the Basic Information of Read/Write Splitting section, click Configure Read/Write Splitting. Then, set the following parameters.
    读写分离参数
    Table 1. Read/write splitting parameters
    Parameter Description
    Latency Threshold The maximum latency allowed for data synchronization between the master and read-only instances. When the data synchronization latency of a read-only instance exceeds this threshold, the system no longer distributes read requests to the read-only instance no matter how high the read weight of the read-only instance is.

    The latency threshold ranges from 0 seconds to 7,200 seconds. Due to limitations in the execution of SQL statements, a read-only instance may synchronize data from the master instance at a certain latency. We recommend that you set this parameter to a value greater than or equal to 30 seconds.

    Read Weight Distribution A higher read weight indicates more read requests to process. For example, the master instance has three read-only instances, and their read weights are 0, 100, 200, and 0, respectively. Then the master instance does not process read requests (write requests are still automatically sent to the master instance), the first and second read-only instances process read requests at the 1:2 ratio, and the third read-only instance does not receive any read or write requests.
    • Automatic Distribution: The system automatically assigns a read weight to each instance based on the instance specifications. After a read-only instance is created, it is automatically added to the read/write splitting link according to the read weight assigned by the system. For more information, see Rules of weight distribution by the system.
    • Customized Distribution: You can manually set the read weight of each instance. The value ranges from 0 to 10000. After a read-only instance is created, its read weight is 0 by default. You must manually specify a read weight for the read-only instance.
    Note
    • If a read-only instance is deleted, then its read weight is deleted and the read weights of the other read-only instances remain unchanged.
    • You cannot specify a read weight for a read-only instance for which areplication delay.
  7. Click OK.

Reference

FAQ for read/write splitting

APIs

API Description
ModifyReadWriteSplittingConnection Used to change the latency threshold and read weights of RDS instances.