Redis periodically stops responding on high load

We found if you use aof persistance along with rdb snapshots, sometimes the rdb updating can delay the aof being updated, which in turn causes writes to redis to block. Turning off aof persistance cured the intermittant latency we were having, which was ok for us as loosing the latest few keys due to a crash was not to important.


Seems that I have found a solution here: http://redis4you.com/articles.php?id=012&name=redis

On linux you should change kernel settings, to optimize TCP operations for high load:

echo 1 > /proc/sys/net/ipv4/tcp_tw_reuse
echo 1 > /proc/sys/net/ipv4/tcp_tw_recycle

And also, make those changes persistant after reboot by adding fallowing to /etc/sysctl.conf:

net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1

Additionaly, it helped to set timeout to 0 in redis.conf:

# Close the connection after a client is idle for N seconds (0 to disable)
timeout 0