Could not get a resource from the pool

异常描述:

  1. redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool

  2.  

    at redis.clients.util.Pool.getResource(Pool.java:22)

  3.  

    at com.derbysoft.jredis.longkeytest.BorrowObject.run(BorrowObject.java:22)

  4.  

    at java.lang.Thread.run(Thread.java:662)

  5.  

    Caused by: java.util.NoSuchElementException: Timeout waiting for idle object

  6.  

    at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:1134)

  7.  

    at redis.clients.util.Pool.getResource(Pool.java:20)

  8.  

    ... 2 more

1、产生原因:客户端去redis服务器拿连接(代码描述的是租用对象borrowObject)的时候,池中无可用连接,即池中所有连接被占用,且在等待时候设定的超时时间后还没拿到时,报出此异常。

2、解决办法:调整JedisPoolConfig中maxActive为适合自己系统的阀值。

<bean id="dataJedisPoolConfig" class="redis.clients.jedis.JedisPoolConfig"> 
        <property name="maxActive" value="300"/> 
       <property name="maxIdle" value="100"/> 
        <property name="maxWait" value="10000"/> 
        <property name="testOnBorrow" value="true"/> 
</bean>

原文地址:https://www.cnblogs.com/--Candice/p/9631830.html

时间: 2024-10-20 05:21:54

Could not get a resource from the pool的相关文章

redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool

今天在链接redis时,遇到问题: redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool Could not get a resource from the pool. redis的配置是: <bean id="jedisPoolConfig" class="redis.clients.jedis.JedisPoolConfig&qu

[故障解决]Could not get a resource from the pool。

注意,这个只是一个解决java里报错"Could not get a resource from the pool"的一种方法,肯定还有其他的情况也导致了"Could not get a resource from the pool",所以要不同原因不同分析. 今儿java开发的哥们找到我,说有一个模块要求增加到某个阿里redis的白名单,但是阿里云的redis是没有白名单这一说的.我问他你的模块报什么错误呢,他说他的模块在日志里显示了如下的内容: 出现了Could

Redis2.1.0:Could not get a resource from the pool的分析

节前的最后一天,sso登陆出现问题,多数用户无法正常登陆.经查询日志,报错如下: 错误日志截取如下2015-02-15 08:40:30,536 INFO [org.jasig.cas.authentication.AuthenticationManagerImpl] - <com.gaochao.oa.module.sso.authentication.handler.FxLdapMixAuthenticationHandler successfully authenticated[usern

redis性能调优笔记(can not get Resource from jedis pool和jedis connect time out)

对这段时间redis性能调优做一个记录. 1.单进程单线程 redis是单进程单线程实现的,如果你没有特殊的配置,redis内部默认是FIFO排队,即你对redis的访问都是要在redis进行排队,先入先出的串行执行. 之所以能够保持高性能是因为以下3点: 1)内存操作 2)数据结构简单 3)大多数是hash操作 redis基本的命令耗时都是us级别的,所以及时是单进程单线程,也能保证很高的QPS. 2.can not get Resource from jedis pool和jedis con

通过jedis连接redis单机成功,使用redis客户端可以连接集群,但使用JedisCluster连接redis集群一直报Could not get a resource from the pool

一,问题描述: (如题目)通过jedis连接redis单机成功,使用JedisCluster连接redis集群一直报Could not get a resource from the pool 但是使用redis客户端可以连接集群(我使用的redis desktop manager) 在java中通过jedis连接redis单机也成功,但使用JedisCluster连接redis集群一直报Could not get a resource from the pool, 我以命令行方式操作是没问题的

redis JedisConnectionException: Could not get a resource from the pool

HTTP Status 500 - Cannot get Jedis connection; nested exception is redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool type Exception report message Cannot get Jedis connection; nested exception is redis.cl

Redis一个异常的解决办法,异常描述:Could not get a resource from the pool

异常描述: redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool at redis.clients.util.Pool.getResource(Pool.java:22) at com.derbysoft.jredis.longkeytest.BorrowObject.run(BorrowObject.java:22) at java.lang.Thread.

java 连接 redis集群时报错:Could not get a resource from the pool

由于弄这个的时候浪费了太多的时间,所以才记录下这个错,给大伙参考下 检查了一下,配置啥的都没问题的,但在redis集群机器上就可以,错误如下: Exception in thread "main" redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool 原因: 是因为我在创集群的时候的ip地址是:127.0.0.1,不是本机的电脑访问的话是不能访问的,

redis使用问题一:Cannot get Jedis connection; nested exception is redis.clients.jedis.exceptions.JedisException: Could not get a resource from the pool] with root cause

首先说下redis最简单得使用,出去配置. 需要在你要使用得缓存得地方,例如mybatis在mapper.xml中加入: <cache eviction="LRU" type="cn.jbit.cache.RedisCache"/> 由于是第一次使用redis,再调试代码得时候报错:Cannot get Jedis connection; nested exception is redis.clients.jedis.exceptions.JedisEx