You can call this operation to modify the latency threshold of the read/write splitting address and the read weight of each instance.

When you call this operation, the instance must meet the following requirements:

  • The instance is in the running state.
  • The instance does not have an ongoing migration task.
Note This operation is applicable to MySQL instances and SQL Server 2017 Cluster Edition instances.


You can use API Explorer to perform debugging.

OpenAPI Explorer provides various functions to simplify API usage. For example, you can retrieve APIs, call APIs, and generate SDK sample code.

Request parameters

Parameter Type Required Example Description
Action String Yes ModifyReadWriteSplittingConnection

The operation that you want to perform. Set the value to ModifyReadWriteSplittingConnection.

DBInstanceId String Yes rm-uf6wjk5xxxxxxx

The ID of the master instance.

ConnectionStringPrefix String No

The prefix of the read/write splitting address. It must be unique and start with a letter. It contains at most 30 characters, including lowercase letters or hyphens (-).

Note By default, the prefix is "instance name + rw".
MaxDelayTime String No 12

The latency threshold. Unit: seconds. If a read-only instance reaches the latency threshold, read requests are no longer sent to the read-only instance.

  • This parameter is not applicable to SQL Server 2017 Cluster Edition instances.

  • If this parameter is not entered, the parameter value remains unchanged.
  • Either MaxDelayTime or DistributionType is required.
DistributionType String No Standard

The mode of read weight distribution. Valid values:

  • Standard: Read weights are distributed according to instance specifications.
  • Custom: Read weights are specified by you.
Note Either MaxDelayTime or DistributionType is required.
Weight String No {“Instanceid1“:”100”,”Instanceid2”:”200”}

The read weight distribution. Enter the read weights for the master instance and its read-only instances. It must be a multiple of 100. The maximum value is 10000. Format: {“Instanceid1“:”Weight”,”Instanceid2”:”Weight”...}.

  • This parameter is required if DistributionType is set to Custom.
  • This parameter is invalid if DistributionType is set to Standard.
AccessKeyId String No LTAIfCxxxxxxx

The AccessKey ID issued by Alibaba Cloud for users to access services.

Response parameters

Parameter Type Example Description
RequestId String 5A77D650-27A1-4E08-AD9E-59008EDB6927

The ID of the request.


Request example

&<Common request parameters>

Normal response examples

XML format


JSON format



For a list of error codes, visit the API Error Center.