解决高并发下Redis连接失败redis.clients.jedis.exceptions.JedisConnectionException Attempting to read from a bro

解决高并发下Redis连接失败redis.clients.jedis.exceptions.JedisConnectionException Attempting to read from a bro_第1张图片

引出问题

当前Redis配置项

解决高并发下Redis连接失败redis.clients.jedis.exceptions.JedisConnectionException Attempting to read from a bro_第2张图片

测压环境

解决高并发下Redis连接失败redis.clients.jedis.exceptions.JedisConnectionException Attempting to read from a bro_第3张图片

出现的问题:

解决高并发下Redis连接失败redis.clients.jedis.exceptions.JedisConnectionException Attempting to read from a bro_第4张图片

解决高并发下Redis连接失败redis.clients.jedis.exceptions.JedisConnectionException Attempting to read from a bro_第5张图片

redis.clients.jedis.exceptions.JedisConnectionException: Attempting to read from a broken connection
	at redis.clients.jedis.Connection.readProtocolWithCheckingBroken(Connection.java:314) ~[jedis-3.1.0.jar:na]
	at redis.clients.jedis.Connection.getStatusCodeReply(Connection.java:236) ~[jedis-3.1.0.jar:na]
	at redis.clients.jedis.BinaryJedis.quit(BinaryJedis.java:257) ~[jedis-3.1.0.jar:na]
	at org.springframework.data.redis.connection.jedis.JedisConnection.close(JedisConnection.java:291) ~[spring-data-redis-2.2.3.RELEASE.jar:2.2.3.RELEASE]


解决方案

添加如下参数
解决高并发下Redis连接失败redis.clients.jedis.exceptions.JedisConnectionException Attempting to read from a bro_第6张图片

重启

解决之后

解决高并发下Redis连接失败redis.clients.jedis.exceptions.JedisConnectionException Attempting to read from a bro_第7张图片

解决高并发下Redis连接失败redis.clients.jedis.exceptions.JedisConnectionException Attempting to read from a bro_第8张图片

参考于:

JedisPool的配置参数整理

你可能感兴趣的:(SpringCloud,Redis,redis,java,缓存,高并发)