How it works...

We will go through each parameter mentioned in the previous section. The two parameters we first set for the Redis instance are both related to the networking between Redis and clients. The first option is timeout. This option means the Redis Server will close the connection after a client has been idle for N seconds. Actually, the timeout specified will be passed into setsockopt() to set the SO_SNDTIMEO option. You can refer to the man page of the socket for details.

The second option is tcp-backlog. This option sets the size of the pending socket request queue. In the Deploying Redis on Linux recipe, we introduced the kernel parameter somaxconn. You should ensure that the value of tcp-backlog is smaller than somaxconn. In ...

Get Redis 4.x Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.