Question
Why do I receive warnings that my On-Premises Contrast Distributed Database Server is using over 99% of its swap space?
Answer
A database server should never** use swap. Using swap always means that either:
- The OS and/or database is configured improperly, or
- The server is too small.
If a database starts to use swap, it is usually the beginning of a death spiral that ends in a server crash.
** Some operating systems insist on setting up some amount of swap "just in case", regardless of the fact that it will never be used.
To disable swap space on Linux:
In the config file /etc/sysctl.conf
, either edit the existing line or add the line:
vm.swappiness=1
Then reboot the server.
Execute cat /proc/sys/vm/swappiness
again to verify that the change took effect (value of 1).