How to debug/fix random occurring Redis::TimeoutError?

That could come from many issues :

  • because you use the SAVE command (it is setup in your conf) generating a lot of I/O and hammering the server, especially if you use EBS volumes on Amazon.
  • because you have a Redis slave (same as before, doing SAVE before mirroring).
  • because you use a KEY * which is very slow on a lot of indexes.

  1. Try "slowlog" command on the redis server to see if there are some "slow query".
  2. Write some logs when "TimeoutError" happens, to see if the "error redis command" in the "slow log".
  3. adjust your timeout setting on the client side。