Redis连接数打满
通过日志查看redis无法连接了,通过查看redis服务得知redis的连接数满了,超过了最大连接数。
省略定位问题过程,直接讲造成问题的原因:
日志打印造成redis连接数不断增长
出现问题的代码:
try {
// 执行策略处理器
logger.info("AtlasFetchAdServiceImpl.getActiveAds entry.getValue={}", JSONObject.toJSONString(entry.getValue(),new AdCacheVoFilter()));
list = strategyHandler.checkoutTarget(entry.getValue()).joint(datePredicate).handle();
}catch (Exception e) {
// 数据源为空
logger.error("getActiveAds strategyHandler.handle strategyHandler={},exception={}, ", JSONObject.toJSONString(strategyHandler),e);
list = null;
}
代码中strategyHandler中有个bean对象cacheService,其中cacheService是提供了redis服务:
<bean id="cacheService" class="com.*.nosql.redis.cache.impl.RedisCacheService">
<property name="redisOperationsTemp