Querying the Top I/O Threads
Function
This API is used to query top I/O statistics of instance database processes and return the results associated with session information. Before calling this API:
- Learn how to authenticate this API.
- Obtain the required region and endpoint.
Constraints
The resource types and operating systems of instances must support the pidstat command.
URI
GET https://{Endpoint}/v3/{project_id}/instances/{instance_id}/top-io-traffics?node_id={node_id}&component_id={component_id}&top_io_num={top_io_num}&sort_condition={sort_condition}
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Explanation: Project ID of a tenant in a region. For details about how to obtain the project ID, see Obtaining a Project ID. Restrictions: None Value range: The value can contain 32 characters. Only letters and digits are allowed. Default value: None |
instance_id |
Yes |
String |
Instance ID. |
node_id |
Yes |
String |
Node ID. It must be a DN node of a non-log role or a CN node, and the node status must be normal. To obtain the value, see Querying the Components of a DB Instance. |
component_id |
Yes |
String |
Component ID. It must be a CN or a DN component of a non-log role. To obtain the value, see Querying the Components of a DB Instance.
|
top_io_num |
No |
Integer |
Number of top I/O threads to be queried in the database process. The default value is 20. The returned result includes information about the top I/O threads with associated session information. The number of records returned in the result cannot exceed the value of this parameter. |
sort_condition |
No |
String |
Top I/O sorting condition. Value:
|
Request Parameters
None
Response Parameters
Parameter |
Type |
Description |
---|---|---|
top_io_infos |
Array of objects |
I/O information. Each element in the list indicates an I/O record. For details, see Table 3. |
Parameter |
Type |
Description |
---|---|---|
thread_id |
String |
Thread ID. |
thread_type |
String |
Thread type. The value can be worker or background. To use this parameter, set enable_thread_pool to on. Value:
|
disk_read_rate |
Integer |
Rate of reading data from disks, in KB/s. |
disk_write_rate |
Integer |
Rate of writing data to the disk, in KB/s. |
session_id |
String |
Session ID. |
unique_sql_id |
String |
SQL ID. |
database_name |
String |
Database. |
client_ip |
String |
IP address of the client. |
user_name |
String |
Username. |
state |
String |
Status. |
sql_start |
Integer |
Start time of the statement. |
Example Request
Top I/Os queried.
GET https://gaussdb-opengauss.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/{instance_id}/top-io-traffics?node_id=42cbf784585e419d9eb33c005f4ced94no14&component_id=dn_6001&top_io_num=20&sort_condition=write
Example Response
{ "top_io_infos" : [ { "thread_id" : "55067", "thread_type" : "worker", "disk_read_rate" : 0, "disk_write_rate" : 1.43, "session_id" : "725", "unique_sql_id" : "3545025713", "database_name" : "postgres", "client_ip" : "23.100.74.131", "user_name" : "root", "state" : "active", "sql_start" : 1690448618689 } ] }
Status Code
- Normal
- Abnormal
For details, see Status Codes.
Error Code
For details, see Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot