I have integrated Redis in my application as a cache. In application.config
I have enabled play-redis module:
play.modules.enabled += "play.api.cache.redis.RedisCacheModule"
I have configured max memory = 1gb
and memory policy to allkeys-lru
(remove any key according to the LRU algorithm) in Redis config file. So when Redis cache reaches to 1gb, old keys will be removed and new data can be inserted.
Redis cache with works fine for 5-6 days but after that, it throws receive timeouts errors. After app restart, Redis is also restarted and cache gets flushed and does not get the error.
The exact error is:
[error] s.i.ListenerActor - Receive timeout
[error] p.a.cache.redis - Command GET classTag::_cursor_UPDATE_VALUE_timoncool for key 'GET' failed.
scredis.exceptions.RedisIOException: Receive timeout to localhost/127.0.0.1:6379
at scredis.io.ListenerActor$$anonfun$reconnecting$1.applyOrElse(ListenerActor.scala:414)
at scala.PartialFunction$OrElse.applyOrElse(PartialFunction.scala:170)
at scala.PartialFunction$OrElse.applyOrElse(PartialFunction.scala:171)
at akka.actor.Actor$class.aroundReceive(Actor.scala:497)
at scredis.io.ListenerActor.aroundReceive(ListenerActor.scala:27)
at akka.actor.ActorCell.receiveMessage(ActorCell.scala:526)
at akka.actor.dungeon.DeathWatch$class.receivedTerminated(DeathWatch.scala:46)
at akka.actor.ActorCell.receivedTerminated(ActorCell.scala:374)
at akka.actor.ActorCell.autoReceiveMessage(ActorCell.scala:511)
at akka.actor.ActorCell.invoke(ActorCell.scala:494)
Does this mean some thread is unable to connect localhost/127.0.0.1:6379
(on this port Redis is running)? As the application could not connect to Redis, the method GET
fails.
What is the exact cause of the timeout issue? How to resolve the issue? Any links to refer?