Working Set Exceeding Memory Causing Disk Thrashing
criticalWhen the database's active working set (frequently accessed data and indexes) exceeds available RAM (InnoDB buffer pool), the instance must fetch pages from disk repeatedly. This causes ReadIOPS to spike, ReadLatency to climb, and overall query performance to degrade as disk I/O becomes the bottleneck.
Monitor FreeableMemory approaching zero and ReadIOPS spiking under load. If scaling up instance RAM causes a dramatic drop in ReadIOPS (as noted in the docs), the working set was not fitting in memory. Look for high innodb_buffer_pool_reads relative to innodb_buffer_pool_read_requests, indicating buffer pool misses. Elevated db.Cache.Innodb_buffer_pool_reads vs. requests confirms the issue.
Upgrade to an instance class with more RAM to accommodate the working set. Increase innodb_buffer_pool_size to use available memory (typically 70–80% of instance RAM). Optimize queries to reduce data scanned—add indexes, rewrite queries, or partition large tables. For read-heavy workloads, deploy read replicas to distribute load and reduce pressure on the primary.