Monitor slow SQL queries and manage running queries in ApsaraDB for ClickHouse to troubleshoot performance issues and maintain cluster health.
Background
Analyzing raw query logs requires installing clients, writing SQL, and manually sorting results with no easy way to visualize trends. ApsaraDB for ClickHouse provides a graphical interface for query logs that lets you search by key dimensions, perform statistical analysis on slow SQL queries, and analyze and summarize log data to identify and resolve performance issues.
Monitor slow SQL queries
The console displays statistical trends and details for slow queries within a specified time range.
-
Log on to the ApsaraDB for ClickHouse console.
-
In the upper-left corner, select the region of your cluster.
-
On the Clusters page, click the Instance list tab. Then, click the target cluster's ID.
-
In the left-side navigation pane, click Query Management.
-
On the Query Management page, click the Slow Queries tab.
-
Set the execution time threshold for slow queries. The default threshold is 3,000 ms.
NoteMinimum threshold: 500 ms.
-
Select Slow SQL Trend or Slow SQL Details from the drop-down list, then apply a time filter to view trends or details.
Click the
icon in the upper-right corner to export the filtered data.
Manage running SQL queries
ApsaraDB for ClickHouse lets you view and terminate running SQL queries in real time to free cluster resources.
-
Log on to the ApsaraDB for ClickHouse console with your Alibaba Cloud account.
-
In the upper-left corner, select the region of the target cluster.
-
On the Clusters page, click the Instance list tab, and then click the ID of the target cluster.
-
In the left-side navigation pane, click Query Management.
-
On the Query Management page, click the Running Queries tab.
-
Filter queries by , , or .
NoteWithout filters, all running queries are displayed.
-
When the cluster fails or resource usage reaches the alert threshold, select the queries to terminate and click Terminate Selected Queries or Terminate All Queries.
Related tasks
-
Additional monitoring metrics are available in monitoring and alerting.
-
Scale your cluster with Vertical and horizontal scaling of Community-Compatible Edition clusters.