Skip to content

PopSQL: limited support.

Migrate now →

Connections by command

Open sessions grouped by what they are doing, against max_connections.

MySQL · SQL
SELECT command,
       COUNT(*) AS sessions,
       (SELECT variable_value FROM performance_schema.global_variables WHERE variable_name = 'max_connections') AS max_connections
FROM information_schema.processlist
GROUP BY command
ORDER BY sessions DESC

This query is part of the "MySQL health" pack: connect the database in DataRunner and install the whole pack — queries, dashboard and checks — at once.