You can call this operation to query the read weights distributed by the system.

If read/write splitting is enabled, you can call this operation to query the read weights specified by the system. To query custom read weights, see DescribeDBInstanceNetInfo.

This operation is applicable to the following instances:

  • MySQL 5.7 High-availability Edition (based on local SSDs)
  • MySQL 5.6
  • SQL Server 2017 Cluster Edition


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 CalculateDBInstanceWeight

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

DBInstanceId String Yes rm-uf6wjk5xxxxxxx

The ID of the master instance.

Response parameters

Parameter Type Example Description

The list of weights specified by the system.

└DBInstanceId String rm-uf6wjk5xxxxxxx

The ID of an instance.

└DBInstanceType String Master

The type of the instance. Valid values:

  • Master.
  • Readonly.
└Weight String 100

The instance weight calculated by the system in real time.

└ReadonlyInstanceSQLDelayedTime String 30

The latency for read-only instances to synchronize the data of the master instance. After a latency of ReadonlyInstanceSQLDelayedTime seconds, the read-only instances synchronize the data of the master instance. Unit: seconds.

RequestId String C816A4BF-A6EC-4722-95F9-2055859CCFD2

The ID of the request.


Request example

&<Common request parameters>

Normal response example

XML format


JSON format



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