Client Error: Could not get a resource from the pool [How to Solve]

Client error: could not get a resource from the pool

1. Reason & Solution

Concurrency is indeed too high, and the link pool configuration parameters are unreasonable. Solution: adjust the configuration parameters; The execution queue of the capacity expansion node redis is occupied by a large number of operations or time-consuming operations. Solution: optimize slow operations; Slow operation is prohibited. There is a hot key solution: split the key and distribute the pressure to each redis node; Increase the local memory. First check the local memory, and then go to a node in redis. The link pool is exhausted. Solution: solve the problem of data skew, execute time-consuming commands, resulting in Ping timeout. Solution: disable time-consuming commands, such as: keys *; Optimize the time-consuming operation. There is a bug in the lower version of jedis package. Solution: upgrade the jedis version

2. Hot key scene sorting

Question 01:

Frequent IP access in a region

Solution:

Increase the application local cache and LRU maintain a certain number of hot IP addresses

Question 02:

Frequently query a large Zset set

Solution:

Split by business dimension; Split by data number segment

3. Sort out the scenario when a node’s link pool is exhausted

Homicide caused by hashtag abuse

Read More: