Memory Issues - Cashed Memory

I’ve noticed, with older (13, 14, 15) and upgraded (to 16, originally something else) distro virtual servers, that especially on boxes where there were multiple or heavy queue usage, I would see the memory slowly grow to where the used and cashed = 100%, the system never lets go. And although it should be fine, eventually the memory swap kicks in and performance starts to fall apart (call stuck in queue no ringing agents, DTMF not recognized, etc.). This resolves if I reboot the server and free the memory, until the cycle repeats.

I have noticed on fresh 16 distro virtual server installs it seems to be better.

For now I am setting a cron to run:
sync; echo 3 > /proc/sys/vm/drop_caches
One time per day to mitigate the issue. This is more of an FYI incase this is impacting anyone else, but has anyone else been dealing with this?

High cache usage is how Linux (and Windows) are designed to operate. It is not a problem. Don’t fight it.

Except, it literally is a problem as soon as the used and cashed = 100% the paging starts to climb and the system grinds to a halt. As soon as the memory is freed, the issues resolve. Something is happening here and there seems to be some correlation to the memory filling up with used and cashed and the swap starting to get used.

Are you running any other databases in the server? Try using linux commands like htop ,top to see which process is using the most memory.

Which kernel are you using?

The point of cache is that, if you have read a block into memory, and you don’t need the memory for anything else, it is better to keep that block, to save having to re-read it, if it is ever needed in the future, so modern systems are designed to run with very little unallocated memory. It sounds like there is something wrong with the OS if it is using swap rather than discarding cache.

Cache does include blocks waiting to be written, so it is possible that you are overrunning the disks, although using swap isn’t actually going to help there, as it still uses the disk.

Linux 3.10.0-1127.19.1.el7.x86_64