You can call the DescribeReadDBInstanceDelay operation to query the latency of data replication between a primary ApsaraDB RDS instance and its read-only instance.
Before you call this operation, make sure that the following requirements are met:
- The primary instance must run the MySQL, PostgreSQL, or PPAS database engine.
- The primary instance must be attached with a read-only instance.
- The region ID of the primary instance must be obtained.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | DescribeReadDBInstanceDelay |
The operation that you want to perform. Set the value to DescribeReadDBInstanceDelay. |
DBInstanceId | String | Yes | rm-bpxxxxxxx |
The ID of the primary instance. |
ReadInstanceId | String | Yes | rr-bpxxxxxxx |
The ID of the read-only instance. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
DBInstanceId | String | rm-bpxxxxxxx |
The ID of the primary instance. |
DelayTime | Integer | 0 |
The latency of data replication between the primary instance and the read-only instance. |
Items | Array of Items |
An array that consists of latency information. |
|
Items | |||
DBInstanceId | String | rm-bpxxxxxxx |
The ID of the primary instance. |
ReadDBInstanceNames | List | "ReadDBInstanceName": ["rr-bpxxxxx"] |
An array that consists of information about the read-only instance. Note This parameter is returned only when the primary instance runs the MySQL database
engine.
|
ReadDelayTimes | List | "ReadDelayTime": ["0"] |
An array that consists of latencies. Note This parameter is returned only when the primary instance runs the MySQL database
engine.
|
ReadonlyInstanceDelay | Array of ReadonlyInstanceDelay |
An array that consists of information about the write-ahead log (WAL) latency. Note This parameter is returned only when the primary instance runs the PostgreSQL or PPAS
database engine.
|
|
ReadonlyInstanceDelay | |||
FlushLag | String | 0 |
The duration that is allowed for the latency in the persistence of WAL data. Unit: seconds. |
FlushLatency | String | 0 |
The data size that is allowed for the latency in the persistence of WAL data. Unit: MB. |
ReadDBInstanceName | String | rr-bpxxxxxxx |
The ID of the read-only instance. |
ReplayLag | String | 0 |
The duration that is allowed for the latency in the playback of WAL data. Unit: seconds. |
ReplayLatency | String | 0 |
The data size that is allowed for the latency in the playback of WAL data. Unit: MB. |
SendLatency | String | 0 |
The data size that is allowed for the latency in the sending of WAL data. Unit: MB. |
WriteLag | String | 0 |
The duration that is allowed for the latency in the write-back of WAL data. Unit: seconds. |
WriteLatency | String | 0 |
The data size that is allowed for the latency in the write-back of WAL data. Unit: MB. |
ReadDBInstanceId | String | rr-bpxxxxxxx |
The ID of the read-only instance. |
RequestId | String | F1BDDEA8-452D-450B-AB10-CD5C5BAFC5DF |
The ID of the request. |
Examples
Sample requests
http(s)://rds.aliyuncs.com/? Action=DescribeReadDBInstanceDelay
&RegionId=cn-hangzhou
&DBInstanceId=rm-bpxxxxxxx
&ReadInstanceId=rr-bpxxxxxxx
&<Common request parameters>
Sample success responses
XML
format
<DescribeReadDBInstanceDelayResponse>
<RequestId>11152741-D854-4E18-920E-64E75D484D57</RequestId>
<DBInstanceId>rm-bpxxxxx</DBInstanceId>
<Items>
<Items>
<ReadDBInstanceNames>
<ReadDBInstanceName>rr-bpxxxxx</ReadDBInstanceName>
</ReadDBInstanceNames>
<ReadDelayTimes>
<ReadDelayTime>0</ReadDelayTime>
</ReadDelayTimes>
<DBInstanceId>rm-bpxxxxx</DBInstanceId>
<ReadonlyInstanceDelay>
</ReadonlyInstanceDelay>
</Items>
</Items>
<DelayTime>0</DelayTime>
</DescribeReadDBInstanceDelayResponse>
JSON
format
{
"RequestId": "11152741-D854-4E18-920E-64E75D484D57",
"DBInstanceId": "rm-bpxxxxx",
"Items": {
"Items": [
{
"ReadDBInstanceNames": {
"ReadDBInstanceName": [
"rr-bpxxxxx"
]
},
"ReadDelayTimes": {
"ReadDelayTime": [
"0"
]
},
"DBInstanceId": "rm-bpxxxxx",
"ReadonlyInstanceDelay": {
"ReadonlyInstanceDelay": []
}
}
]
},
"DelayTime": "0"
}
Error codes
For a list of error codes, visit the API Error Center.