随意找一个线程查察堆内存
- thread -428

这是能确认就是api一向转圈的题目,就是这个redis获取毗连的代码导致的,
解读这段内存代码 全部线程都在等 @53e5504e这个工具开释锁。于是jstack 全局搜了一把53e5504e ,没有找到这个工具地址线程。
自此。题目缘故起因能确定是 redis毗连获取的题目。可是什么缘故起因造成获取不到毗连的还不能确定
再次执行 arthas 的thread -b (thread -b, 找出当前阻塞其他线程的线程)

没有功效。这边和想的纷歧样,应该是能找到一个阻塞线程的,于是看了下这个呼吁的文档,发明有下面的一句话

好吧,我们恰恰是后者。。。。
再次清算下思绪。这次修改redis pool 设置,将获取毗连超时时刻配置为2s,然后等题目再次复现时调查应用最后正常时干过什么。
添加一下设置
- JedisConnectionFactory jedisConnectionFactory = new JedisConnectionFactory();
- .......
- JedisPoolConfig config = new JedisPoolConfig();
- config.setMaxWaitMillis(2000);
- .......
- jedisConnectionFactory.afterPropertiesSet();
重启处事,守候。。。。
又过一天,再次复现
ssh 处事器,搜查tomcat accesslog ,发明大量api 哀求呈现500,
- org.springframework.data.redis.RedisConnectionFailureException: Cannot get Jedis connection; nested exception is redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource fr
- om the pool
- at org.springframework.data.redis.connection.jedis.JedisConnectionFactory.fetchJedisConnector(JedisConnectionFactory.java:140)
- at org.springframework.data.redis.connection.jedis.JedisConnectionFactory.getConnection(JedisConnectionFactory.java:229)
- at org.springframework.data.redis.connection.jedis.JedisConnectionFactory.getConnection(JedisConnectionFactory.java:57)
- at org.springframework.data.redis.core.RedisConnectionUtils.doGetConnection(RedisConnectionUtils.java:128)
- at org.springframework.data.redis.core.RedisConnectionUtils.getConnection(RedisConnectionUtils.java:91)
- at org.springframework.data.redis.core.RedisConnectionUtils.getConnection(RedisConnectionUtils.java:78)
- at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:177)
- at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:152)
- at org.springframework.data.redis.core.AbstractOperations.execute(AbstractOperations.java:85)
- at org.springframework.data.redis.core.DefaultHashOperations.get(DefaultHashOperations.java:48)
找到源头第一次呈现500处所, (编辑:湖南网)
【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!
|