Optimizing Redis allows you to gain performance improvement without scaling your deployment up (bigger machines/nodes) or out (more machines/nodes). This gained performance can either be used, or traded for cost savings by reducing the amount of compute resources provisioned. The profile of requests made by clients will vary based on the use case. This means there is no one size fits all set of tuning parameters for Redis. Use the information below as general guidance on tuning Redis.
In the Configure Redis single-node section of the Learn how to deploy Redis on Arm learning path, a bare minimum file server configuration was discussed. In this section, a tuned file server configuration is discussed.
A tuned top level configuration file /etc/redis/redis.conf is shown below. Only performance relevant parameters are discussed.
################################ SNAPSHOTTING #################################
save ""
stop-writes-on-bgsave-error no
################################### CLIENTS ####################################
maxclients 10000
############################## MEMORY MANAGEMENT ################################
maxmemory <bytes>
################################ THREADED I/O #################################
io-threads 1
save
:
stop-writes-on-bgsave-error
:
maxclients
:
maxmemory
:
io-thread
:
Pipelining is a feature primarily implemented on the client side. When a client uses the Redis client library like memtier does then the client can choose to use pipelining, which is a more effective approach for achieving parallelism. You should use a pipeline ranging from 1 (default) to approximately 20 as a large pipeline value (> 20) will increase latency. You will need to experiment and decide what pipeline value makes the most sense for your use case.