Database Autonomy Service (DAS) provides session management for ApsaraDB RDS for MySQL instances. Monitor active sessions, abnormal sessions, access sources, and SQL statements in real time. Terminate sessions, throttle SQL, run SQL diagnostics, and optimize SQL directly from the console.
Prerequisites
Your RDS instance runs one of the following MySQL versions and editions:
MySQL version | Supported editions |
MySQL 8.0 | RDS High-availability Edition, RDS Enterprise Edition, RDS Cluster Edition |
MySQL 5.7 | RDS High-availability Edition, RDS Enterprise Edition, RDS Cluster Edition |
MySQL 5.6 | RDS High-availability Edition |
MySQL 5.5 | RDS High-availability Edition |
Open session management
Go to the Instances page. In the top navigation bar, select the region in which the RDS instance resides. Then, find the RDS instance and click the ID of the instance.
In the left-side navigation pane, choose Autonomy Services > Diagnostics.
Click the Session Management tab.
View and manage instance sessions
The Session Management section displays real-time session data: exceptions, active sessions, longest execution duration, CPU utilization, and connection usage.
Analyze SQL within a 10-second window
Click Previous Version in the upper-right corner of the section, then click 10s SQL Analysis. The displayed dialog box displays SQL statistics, slow query logs, and an SQL overview captured within a 10-second window. For details, see 10-second SQL analysis.
Throttle SQL
Click SQL Throttling to open the SQL Throttling panel. Configure threshold-based SQL throttling to limit sessions. For details, see SQL throttling.
Diagnose and optimize SQL
Click Previous Version in the upper-right corner of the section. Select the session and click Optimize to open the SQL Diagnostic Optimizationdialog box and view diagnostic results.
To apply a suggestion, click Copy and paste the optimized SQL statement into your database client or Data Management (DMS).
To dismiss a suggestion, click Cancel.
NoteDAS evaluates SQL complexity, table data volume, and database load during diagnostics. Results may take more than 20 seconds to return. The SQL diagnostic engine provides diagnostic results, optimization suggestions, and expected optimization benefits. Decide whether to accept the suggestions based on the provided information.
Export active sessions
Export active session data from the Instance Sessions section for offline analysis.
Terminate sessions
Select the sessions to terminate. Enter the username and password of the database account that established the sessions, or use a privileged account that has permissions to terminate sessions from other accounts.
Check the User column in the session list to identify the database account for each session.
Click End Session History to view records of previously terminated sessions.
View session statistics
The Session Statistics section shows summary information: total sessions, total running sessions, and max session runtime. View and export session statistics grouped by user, access source, or database.
Enable automatic SQL throttling
Click Enable Automatic Throttling to turn on automatic SQL throttling. After you configure the trigger conditions, DAS automatically throttles SQL when those conditions are met. This manages the number of access requests and concurrent SQL requests on your instance to maintain database availability. For details, see Automatic SQL throttling.
FAQ
Why does a percent sign (%) appear in the Access Source column?
What sessions are marked as abnormal?
References
DAS autonomy features can automatically diagnose and optimize SQL statements in your database sessions: