swap_usage
CRITICAL
Rule IDs: os_001
Overview
- Purpose
- Host memory pressure indicator (swap in use), typically from OS-level diagnostics rather than
SHOW VARIABLES. - Dynamic (MySQL 8.4 reference)
- Not a MySQL system variable — address at the OS / hypervisor layer.
- Default value
- N/A
- Version and product notes
- N/A
- Documentation
- Primary reference depends on product (MySQL, MariaDB, Percona, or OS documentation).
What is checked
Rules that reference this variable, with their severity and what each rule detects:
- CRITICAL
os_001: Investigate why swap is active. Reduce memory pressure (lower buffer pool, max_connections) or add RAM. Swap + MySQL = disaster.
Tuning guidance
- Recommended actions:
- Investigate why swap is active. Reduce memory pressure (lower buffer pool, max_connections) or add RAM. Swap + MySQL = disaster.
- Trade-offs: OS tuning (swap, THP, NUMA, I/O scheduler) operates outside MySQL but directly affects database performance. Changes require root access and may need a reboot.
Example
Reduce swap use by tuning workload, RAM, or VM sizing; follow your OS documentation.