Setting Redis Timeouts to deal with Broken Pipe errors
search cancel

Setting Redis Timeouts to deal with Broken Pipe errors

book

Article ID: 292926

calendar_today

Updated On:

Products

Redis for VMware Tanzu

Issue/Introduction

Symptoms:

Redis connection logs show errors of this kind:

2017-12-21T11:38:04.883-06:00 [APP/PROC/WEB/0] [OUT] 
Caused by: redis.clients.jedis.exceptions.JedisConnectionException: java.net.SocketException: 
Broken pipe (Write failed)

Environment


Cause

The client (in this case jedis) does not play well with connection timeouts.

 

Resolution

Short answer: In Redis for PCF the 'idle connection timeout' is not configurable. 

Broken pipe issues can be simulated by adjusting the client timeout. Apart from the Redis timeout, nothing can be configured with regard to idle connection handling. There is no other reason that Redis would terminate active and normal connections.

For dedicated nodes, there is no client connection timeout. Idle connections will persist indefinitely.

For on-demand, we set the client connection timeout to 3600s and then the server will close the connection. This only applies to normal clients (non-pub-sub). Jedis seems to not play well with connection timeouts; see: https://github.com/xetorthio/jedis/issues/185

We do provide a way for Operators to set the Redis client timeout in the tile for on-demand plans. Setting the timeout to "0" will disable it.