Adrien Personally I would set;
timeout 90
tcp-keepalive 60
maxmemory 250mb
maxmemory-policy allkeys-lru
tcp-backlog 4096
timeout
= Close the connection after a client is idle for 30 seconds
tcp-keepalive
= keep the connection alive for 60 seconds to increase performance
maxmemory
= can be lowered but should be sufficient
maxmemory-policy
= Keeps most recently used keys; removes least recently used (LRU) keys
tcp-backlog
= In high requests-per-second environments you need an high backlog in order to avoid slow clients connections issues. (cat /proc/sys/net/core/somaxconn
for the value)
These settings by default are set to;
timeout
= 0 = never times out, uses resources
tcp-keepalive
= 300, 5 minutes to keep the connection alive
maxmemory
= 0 = unlimited memory usage
maxmemory-policy
= noeviction = which means Redis doesn't save key/values when memory limit is reached.
tcp-backlog
= only 511 connections