0

I use azure redis with Spring-data and normally the entities saved onto it are in the ranges of 200KB- 1MB per request, but now when the entity is ~6MB, I get the exception:

org.springframework.data.redis.RedisConnectionFailureException: java.net.SocketTimeoutException: Read timed out; nested exception is redis.clients.jedis.exceptions.JedisConnectionException: java.net.SocketTimeoutException: Read timed out
Caused by: redis.clients.jedis.exceptions.JedisConnectionException: java.net.SocketTimeoutException: Read timed out
Caused by: java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method) ~[na:1.8.0_131]
at java.net.SocketInputStream.socketRead(SocketInputStream.java:116) ~[na:1.8.0_131]
at java.net.SocketInputStream.read(SocketInputStream.java:171) ~[na:1.8.0_131]
at java.net.SocketInputStream.read(SocketInputStream.java:141) ~[na:1.8.0_131]
at java.net.SocketInputStream.read(SocketInputStream.java:127) ~[na:1.8.0_131]

Correct me if I'm wrong but 6MB shouldn't be a huge problem. I also tried bumping up the time-out overriding the JedisShardInfo, but the problem still persists. Any thoughts/help on this would be really appreciated, thanks in advance.

Manish Karki
  • 473
  • 2
  • 11
  • Can you please share your redisConnection pool configuration. Check if it's connection timeout is set less that it need to persist data of 6MB. – Anuj Vishwakarma Jan 22 '19 at 07:20
  • Hey Thanks for the response, but as I mentioned, we didn't have the timeout property overriden before, and as of now when trying to , it doesn't solve `java.net.SocketTimeoutException`. The code however looks like this `JedisPoolConfig config = new JedisPoolConfig(); config.setMaxTotal(environment.getRequiredProperty(REDIS_MAX_POOL_SIZE, Integer.class)); config.setMaxIdle(environment.getRequiredProperty(REDIS_MAX_IDLE_SIZE, Integer.class));` P.S the size 6MB is of single entity and shouldn't be affected by the maxTotal. – Manish Karki Jan 24 '19 at 15:58

1 Answers1

0

We applied a limit to the entity being persisted to redis to 4 MB and we haven't seen that issue any more.

Manish Karki
  • 473
  • 2
  • 11