One issue related to mysql memory usage that happens quite often is swapping. We all wonder when our server goes swapping with just one mysql instance of average activity running on it. As DBA's we do find nothing in any of the below statistics.
1. Activity on the server - Looks OK
2. Is server running with in the configured buffer pools(Innodb and Myisam key buufers) - Yes
3. Server full of connections ? - NO
4. But free -m showing swapping ? - YES
Why all this happens ???
Here are some key points on linux memory management.
1. When we see free -m, we have to see "free" column under "buffers/cache" section which is actual free
ram not under "Mem" sections
2. Some times even there is free ram memory, Linux starts using swap memory based on
"/proc/sys/vm/swappiness" setting.
Ex: If /proc/sys/vm/swappiness = 60 then,
Linux starts using swap when the ram is 40% occupied.
Wish this helps.....
1. Activity on the server - Looks OK
2. Is server running with in the configured buffer pools(Innodb and Myisam key buufers) - Yes
3. Server full of connections ? - NO
4. But free -m showing swapping ? - YES
Why all this happens ???
Here are some key points on linux memory management.
1. When we see free -m, we have to see "free" column under "buffers/cache" section which is actual free
ram not under "Mem" sections
2. Some times even there is free ram memory, Linux starts using swap memory based on
"/proc/sys/vm/swappiness" setting.
Ex: If /proc/sys/vm/swappiness = 60 then,
Linux starts using swap when the ram is 40% occupied.
Wish this helps.....