Because VoltDB is an in-memory database, proper memory management is vital to the effective operation of VoltDB databases. Two important aspects of memory management are:
The following sections explain how best to configure these features for optimal performance of VoltDB.
Swapping is an operating system feature that optimizes memory usage when running multiple processes by swapping processes in and out of memory. However, any contention for memory, including swapping, will have a very negative impact on VoltDB performance and functionality. You should disable swapping when using VoltDB.
To disable swapping on Linux systems, use the
swapoff command. If swapping cannot be disabled for
any reason, you can reduce the likelihood of VoltDB being swapped out by setting the kernel parameter
vm.swappiness to zero.
Although swapping is bad for memory-intensive applications like VoltDB, the server does make use of virtual memory
(VM) and there are settings that can help VoltDB make effective use of that memory. First, it is a good idea to enable VM
overcommit. This avoids VoltDB encountering unnecessary limits when managing virtual memory. This is done on Linux by
setting the system parameter
vm.overcommit_memory to a value of "1".
$ sysctl -w vm.overcommit_memory=1
Second, for large memory systems, it is also a good idea to increase the VM memory mapping limit. So for servers
with 64 Gigabytes or more of memory, the recommendation is to increase VM memory map count to 1048576. You do this on
Linux with the system parameter
max_map_count. For example:
$ sysctl -w vm.max_map_count=1048576
Remember that for both overcommit and the memory map count, the parameters are only active while the system is
running and will be reset to the default on reboot. So be sure to add your new settings to the file
/etc/sysctl.conf to ensure they are in effect when the system is restarted.