MySQL 8.4 already ships the monitoring most people install a tool for. performance_schema and the sys schema are on by default and answer “what’s slow” and “what’s using memory” without installing anything. What follows is real output from this machine’s server.
Table of Contents
What’s actually running, right now
The single most useful query for “what is my database doing” — top statements by total time, straight from performance_schema, no product installed:
SELECT DIGEST_TEXT, COUNT_STAR, ROUND(SUM_TIMER_WAIT/1000000000000,4) AS total_sec
FROM performance_schema.events_statements_summary_by_digest
ORDER BY SUM_TIMER_WAIT DESC LIMIT 5;
DIGEST_TEXT COUNT_STAR total_sec
COMMIT 2153230 320.4502
SELECT `SLEEP` (?) 96 202.0678
SELECT SQL_NO_CACHE * FROM `big` 89 130.4182
SELECT SQL_NO_CACHE * FROM `t_a` 45 111.8556
SELECT SQL_NO_CACHE * FROM `t_b` 45 111.2095
The sys schema wraps the same data in human units — sys.statement_analysis returns the identical five rows with total_latency already formatted as "5.34 min" instead of a raw picosecond counter. If events_statements_summary_by_digest looks empty on your server, check the consumer is on:
SELECT * FROM performance_schema.setup_consumers WHERE NAME LIKE '%statements%';
NAME ENABLED
events_statements_current YES
events_statements_history YES
events_statements_history_long NO
statements_digest YES
Buffer pool and connection health, without a dashboard
SHOW GLOBAL STATUS WHERE Variable_name IN
('Threads_connected','Innodb_buffer_pool_pages_total','Innodb_buffer_pool_pages_free',
'Innodb_buffer_pool_reads','Innodb_buffer_pool_read_requests','Slow_queries','Uptime');
Threads_connected 1
Innodb_buffer_pool_pages_total 8192
Innodb_buffer_pool_pages_free 798
Innodb_buffer_pool_reads 4920077
Innodb_buffer_pool_read_requests 1810208970
Slow_queries 1
Uptime 816598
Buffer pool hit ratio from those two counters — 1 − (reads / read_requests) — is 99.73% on this server right now. That number, not a bare “keep it under 100%,” is what a real gate should compare against over time. Sizing the buffer pool itself is a separate question with a sourced answer already — see the buffer pool and memory tuning guide. To confirm the same built-ins on your own server, run monitoring-and-alerting-tools.sh: it only reads, checking that performance_schema is ON, that the sys schema exists, that the digest table and sys.statement_analysis can be queried and that the hit ratio can be computed from the live counters, and it skips everything if no server answers on 127.0.0.1 as root.
Setting thresholds from your own baseline
A single universal percentage is the wrong shape for most metrics: 85% CPU on a batch-analytics box that’s supposed to be busy is normal; 85% CPU on a latency-sensitive OLTP server serving p99 reads is already a problem. Buffer pool usage near 100% and swapping are two different kinds of memory pressure — InnoDB using its own allocated pool fully (expected, even good) versus the OS swapping because total system memory is exhausted (a host-level condition, not something Innodb_buffer_pool_pages_free alone tells you). Set thresholds from your own workload’s baseline — the query above gives you the counters to build that baseline from — rather than importing a number nobody sourced.
When you outgrow the built-ins
The native views cover single-server, point-in-time and rolling-window questions. What they don’t do is store history across a restart (events_statements_summary_by_digest resets when the server does), alert you proactively, or aggregate across multiple hosts. Getting a server into something that can do those starts one step earlier, with an exporter that publishes these same counters on an HTTP endpoint for a scraper to collect. That’s the actual case for a dedicated tool — not “more detail than SHOW STATUS,” which performance_schema already provides for free. For a single external tool worth running here, see the MySQLTuner guide, which reads these same native counters and turns them into recommendations in one pass.