Setting client connection options
For the clients of Redis, there are several important configuration parameters on the server side. In this recipe, we will introduce these parameters and also offer you the best practice of setting these client connection options.
Getting ready…
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.
How to do it...
The steps for configuring the clients are as follows:
- To set the networking parameters for clients, add the following lines into the Redis configuration file,Â
redis.conf
:
timeout 0
tcp-backlog 511
- To set the maximum number of clients and
tcp-keepalive
interval for a Redis instance and Redis Sentinel, add the following line into the Redis configuration file and Redis Sentinel configuration file:
maxclients 10000
tcp-keepalive 300
- To set the client buffer parameters for clients, add the following lines in the Redis configuration file,Â
redis.conf
:
client...