Problem Description
Recently, the project is doing performance pressure testing. The framework uses spring boot 2.1.2 + jedis 2.9.1. 80 concurrent continuous pressure testing takes 4-5 minutes and the service freezes. All requests are pending. Check the service log without any exceptions. Check that other interfaces that do not use redis can request normally.
Find problem ideas
-
Checked the connection configuration of redis, it is normal enough
-
Then use jstack to look at the stack information
I found a lot of WAITING threads, and looking down, they are all waiting caused by the getResource method of redis.
-
View the source code of redis
Jedis.java
@Override public void close() { if (dataSource != null) { //1 if (client.isBroken()) { this.dataSource.returnBrokenResource(this); } else { this.dataSource. returnResource(this)