Mysql – Swap Usage but high Freeable memory

amazon-rdsawsmemoryMySQL

We have an AWS RDS with a MySQL database. Buffer Pool size is only 144GB out of the total available 244GB RAM. However, even at such a low RAM config, we see Swap Usage happening. Does anyone have any idea on how I can go about figuring out what is causing the swap usage?

We have Performance Insights enabled, and so also Enhanced monitoring. The Swap Committed value did go back down, but we are essentially wasting about 100GB of RAM, as increasing Buffer Pool size any further aggressively increases Swap usage.

Best Answer

There isn't much you can do about this with RDS. It means the OS decided that whatever got swapped out was less valuable than more page cache. You have no control over this with huge pages or vm.swappiness controls like you would on an EC2 instance.

Related Question