-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Redis 4.x Cookbook

Although you can install Redis on almost all modern operating systems (OS) by compiling its source code, Linux is the most common OS running Redis. Before you start the Redis instance, it is often necessary to set some Linux kernel and OS level parameters to proper values, in order to obtain the maximum performance in the production environment. In this recipe, we will introduce some vital kernel and OS parameters or settings for Redis.
You need to finish the installation of the Redis Server, as we described in the Downloading and installing Redis recipe in Chapter 1, Getting Started with Redis.
The configurations for deploying Redis on Linux are as follows:
~$ sudo sysctl -w vm.overcommit_memory=1
~$ sudo sysctl -w vm.swappiness=0
To persist these parameters add the following:
echo vm.overcommit_memory=1" >> /etc/sysctl.confecho "vm.swappiness=0" >> /etc/sysctl.conf
To check if...