Session management
PolarDB for MySQL quick diagnostics integrates some Database Autonomy Service (DAS) capabilities. Use session management to view session statistics for an instance.
Procedure
-
Log in to the PolarDB console。
-
In the upper-left corner, select the region where the cluster is deployed.
On the Clusters page, click the ID of the target cluster.
In the left-side navigation pane, choose .
-
Click the Sessions tab.
-
On the Sessions page, view details on the Instance Sessions and Session Statistics tabs.
-
Instance Sessions: Displays current sessions with key metrics such as exception count, active session count, maximum execution time, CPU utilization, and connection utilization. Available actions: Enable Auto Refresh, Export Session List, End All Sessions, and History of Ended Sessions. The session table lists details including ID, User, Host, Database, Command, Execution Time (s), State, SQL, and Transaction Duration (s).
State field description
The State field displayed in the session management console corresponds to the
information_schema.processlistsystem table'sSTATEcolumn. You can run the following SQL statement to query session state information consistent with the console:SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE FROM information_schema.processlist;Common state values include:
State
Description
NULLThe session is idle (Sleep command).
User sleepThe session is executing a SLEEP function.
executingA query is being executed.
Sending dataThe session is sending query result data to the client.
Waiting on empty queueThe session is waiting on a task queue. This state typically appears in event scheduler (event_scheduler) sessions.
This field corresponds one-to-one to the State column displayed in the console. You can also directly query
information_schema.processlistby using SQL to obtain the same information.Note-
If an abnormal parameter session occurs during an SQL request, select the session and click Kill Selected or Optimize Selected Sessions to analyze and configure the session.
-
Click 10s SQL Analysis in the upper-right corner to view the most frequently executed SQL statements and slow queries within a 10-second period. 10-second SQL analysis10-second SQL analysis.
-
Click SQL throttling to limit database requests and SQL concurrency for service availability. SQL throttlingSQL throttling.
-
-
Session Statistics: Displays session counts and durations grouped by dimension. Four sections: Overview (total sessions, running sessions, longest runtime among running sessions), By User (by database user), By Source (by client IP), and By Database (by database name). Each section shows active and total counts.
-
Best practices
High CPU utilization for PolarDB for MySQL