What do I watch, which settings matter, and where do I look first?
The other half of the job: the signals I watch, the logs I read, the parameters that decide most outcomes, and the commands that show the truth on a live server.
The signals I put on a dashboard and alert on, and why each one matters.
Example dashboard: the thresholds are starting points I would tune per system, and the colors are made up for the picture.
| Signal | Why I watch it | Where it comes from |
|---|---|---|
| Query latency and errors | The numbers users feel; everything else explains them. | performance_schema.events_statements_summary_by_digest |
| Connections | Each one is a thread; near max_connections new requests fail. | Threads_connected, Threads_running |
| History list length | Long transactions stop purge; undo grows and reads slow down. | INNODB_METRICS trx_rseg_history_len |
| Replication or group state | A failover loses what a replica did not have. | SHOW REPLICA STATUS, replication_group_members |
| Buffer pool | When the working set stops fitting, reads go to disk. | Innodb_buffer_pool_reads vs read requests |
| Disk, binlogs and backups | Binlogs fill disks; a backup counts only after a tested restore. | The OS, binlog_expire_logs_seconds, your backup tool |
Run the checks on your own server with the health check.
Same idea as PostgreSQL: exact names, one job per log, one check per incident. The rule is written once on the PostgreSQL page. This table adds the operational logs a DBA reads first: server, error, slow.
| Log | Exact file name | Where it sits (on-prem) | What it does | What to check in it |
|---|---|---|---|---|
| MySQL Redo log | #ib_redo0 · #ib_redo31 | #innodb_redo/ in the datadir (before 8.0.30: ib_logfile0/1 in the datadir root) | Physical record of page changes. Replayed at startup to rebuild dirty pages after a crash. | Checkpoint age in SHOW ENGINE INNODB STATUS (LOG section). Age near capacity means write stalls are coming. |
| MySQL Binary log | mysql-bin.000001, .000002, … | Datadir (path set by log_bin) | Logical record of every committed change. Replicas replay it. It is the second half of point-in-time recovery. | SHOW BINARY LOGS. Check total size and the oldest file. Retention must exceed the longest replica outage. |
| MySQL Error + slow logs | <hostname>.err · *-slow.log | Datadir / /var/log/mysql/ | Error log: startup, crashes, warnings. Slow log: statements over long_query_time, with rows examined. | Error log at the incident start. Slow log digested (pt-query-digest), ranked by total time, not by count. |
Same three outage rules as PostgreSQL: Safe live lever, Planned change, Do not touch. What each one means is written once on the PostgreSQL page.
| Parameter | What it does | During an outage |
|---|---|---|
| innodb_buffer_pool_size | Size of the page cache. The single most important MySQL setting. Typically 70 to 80% of RAM on a dedicated server. | Planned change. It is resizable online in 8.0 (SET GLOBAL), but resizing under load is slow and competes with the workload. Verify headroom first. Watch Innodb_buffer_pool_resize_status. |
| innodb_redo_log_capacity | Total redo log size (8.0.30 and later). It bounds checkpoint age headroom. | Safe live lever (dynamic). Use it when checkpoint age is pinned near capacity and writes are stalling. Raise it, then confirm age falls. |
| max_connections | Cap on concurrent connections. Each thread costs memory. | Short bridge only. It is dynamic, so a modest raise can stop "too many connections" errors while you fix the cause. The cause is almost always missing pooling (ProxySQL) or leaked connections. A big raise converts a connection incident into a memory incident. |
| innodb_flush_log_at_trx_commit | The durability dial. 1 means redo fsynced at every commit (safe). 2 means written to the OS, fsynced about once a second. 0 means about once a second entirely. | Do not relax it mid-outage to buy speed, unless the business explicitly accepts losing up to about 1 s of commits per crash. You would be trading tonight's latency incident for a future data-loss incident. |
Same rule as PostgreSQL: every mechanism above is observable on a running server in under two minutes. The full version is on the PostgreSQL page.
Run it locally: docker-compose-mysql.yml starts MySQL 8.4 on port 3306 with a shop database. docker compose -f docker-compose-mysql.yml up -d, then run the commands below against it.
-- where is everything? SHOW VARIABLES LIKE 'datadir'; SHOW VARIABLES LIKE 'innodb_buffer_pool_size'; $ ls /var/lib/mysql/shop -- → users.ibd, orders.ibd, … -- the binary log SHOW BINARY LOGS; SHOW BINLOG EVENTS IN 'mysql-bin.000001'; $ mysqlbinlog mysql-bin.000001 | less -- redo log position + undo backlog SHOW ENGINE INNODB STATUS\G -- replica state and lag SHOW REPLICA STATUS\G
How do databases actually work? From one row on disk to transactions: the words you need, PostgreSQL, MySQL and MongoDB from the files up, then Redis, Cassandra and vector search, side by side, and the query and concurrency traps.