Using Swap
There is a Linux kernel parameter called swappiness that controls when the operating system will start using the swap space. This parameter can be set to values between 0 and 100. A lower value tells the kernel to use the swap space less frequently, and a higher value tells it to use the swap space more frequently. The default value is 60.
Here are some special cases of using swaps:
Value |
Strategy |
---|---|
|
|
|
|
|
|
In a scenario where Redis needs to access from the swap space, the OS needs to move the necessary pages back into the RAM. During this process, Redis is blocked until the OS finishes its job.
We recommend that you use a swappiness of 0 when your data always fits into the RAM and 1 when you are not sure...