Mongodb – RHEL 7.4, heavy workload(s) and SWAP usage

linuxmariadbmongodb

This might not be the correct board for this, but since I'm a DBA and I'll ask here.

I have several RHEL 7.4 servers, running a mix of MariaDB (10.1, 10.2) and MongoDB (3.4). The problem was happening with RHEL 7.3 as well.

All of these servers have 256Gb of memory with local SSD array storage, and even given heavy workloads the highest active memory-in-use footprint is less than 100Gb at any one time. I've been profiling this for quite some time:

On each of these servers, even though there is always plenty of free memory available, the systems are incrementally going into swap. I've tried setting the vm.swappiness value to 1, but incremental jumps of swap are still happening.

Is this happening to anyone else? Does anyone know, with a large amount of memory available, if setting swappiness to 0 has ill effects?

Thanks

Best Answer

If you have 8GB swap, 256 GB physical memory and swappiness=1, with memory usage nearing 72Gb, it's acceptable to swap operations almost 700MB (72GB * 1%), then the 100MB swap usage that you had seen is pretty normal.

Be sure that your 1TB daily data load doesn't exhaust your physical memory and you can change swappiness to 0 without side effects.

But do you have a quite low swap rate in your setup. Do you really need to avoid swap?