前几天公司后端系统出现了故障,导致app多个功能无法使用,查看日志,发现日志出现较多的redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool的异常信息,显而易见,jedis/redis出现了问题。因为是connection的相关的问题,所以看了一下jedis和连接数相关的配置项,maxIdle和maxTotal都是200,jedis的封装也在finally中释放了connection,所以初步猜测问题发生在redis服务端

1.jedis机器-->ping-->redis机器,毫秒级的响应时间----网络畅通

2.使用netstat -apn |grep redis-server连接数为20多个--网络连接数正常

3.free  -m内存使用率60%---(表面上)内存够用

4.df     -h磁盘使用率15%---磁盘空间充足

5.使用redis-cli,执行info命令,client部分:

#Clients

connected_clients:18

client_longest_output_list:0

client_biggest_input_buf:0

blocked_clients:0

clients数量也正常

6.使用redis-cli,执行ping命令,异常信息出来了:

(error)MISCONF Redis is configured to save RDB snapshots, but is currently

not able to persist on disk. Commands that may modify the data set

are disabled. Please check Redis logs for details about the error.

然后查看redis日志,出现了

WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.

问题已经很清晰了,bgsave会fork一个子进程,因为vm.overcommit_memory = 0,所以申请的内存大小和父进程的一样,由于redis已经使用了60%的内存空间,所以fork失败

解决办法:

/etc/sysctl.conf 添加 vm.overcommit_memory=1

sysctl  vm.overcommit_memory=1

jedis异常:Could not get a resource from the pool相关推荐

  1. 使用redis做缓存,遇到Could not return the resource to the pool异常怎么办呐!

    使用redis做缓存,短短几天就遇到两次redis.clients.jedis.exceptions.JedisException: Could not return the resource to ...

  2. Java异常 | JedisException: Could not get a resource from the pool

    1. 异常现象 20190429 16:27:58,200 | ERROR | (RedisClient.java:262)RedisClient:262 - jedisInfo ... NumAct ...

  3. redis使用中经常出现 Could not get a resource from the pool 异常,解决办法总结

    背景: 最近使用jedis(redis)开发一项功能,查阅日志发现,服务运行一段时间之后,就会出现 redis.clients.jedis.exceptions.JedisException: Cou ...

  4. redis中 Could not get a resource from the pool 异常解决

    描述 这个错误产生的前提是这样的,将数据存入redis(新安装的)中,在通过连接池获取jedis实例时,产生如下错误( Could not get a resource from the pool). ...

  5. springboot报错:Could not get a resource from the pool redis.clients.jedis.exceptions.JedisConnection

    运行项目时报错: 2022-04-15 19:27:54.052 ERROR 9676 --- [nio-8181-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServl ...

  6. 使用客户端jedis时报错Could not get a resource from the pool 以及使用Spring Data Redis报错解决方法

    一.Jedis 报错 今天在使用jedis时,一直报错 Could not get a resource from the pool 在网上找了好多解决的方法,并且找了半天错误,才发现是我的启动方式有 ...

  7. redis提示Could not get a resource from the pool(jedis连接池配置)

    起初在JedisPool中配置了50个活动连接,但是程序还是经常报错:Could not get a resource from the pool 连接池刚开始是这样配置的: JedisPoolCon ...

  8. 解决Could not get a resource from the pool 异常问题

    在项目中实现数据库查询内容,用到redis的时候出现 Could not get a resource from the pool ,试了挺多方法都不行,包括改最大.最小连接数maxIdle.maxI ...

  9. 解决Redis问题:JedisConnectionException: Could not get a resource from the pool

    1.问题描述: redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the p ...

最新文章

  1. 可构建AI的“AI”诞生:几分之一秒内,就能预测新网络的参数
  2. 昨天还在for循环里写加号拼接字符串的那个同事,今天已经不在了
  3. activiti 图片
  4. Nhibernate.hbm2ddl.auto配置详解
  5. jwt token 太长_理解 JWT 鉴权的应用场景及使用建议
  6. 什么是Maven快照(SNAPSHOT)
  7. leetcode 1221 python
  8. mockito模拟依赖注入_Mockito间谍–部分模拟
  9. 自学-Linux-老男孩Linux77期-day7
  10. Redhat 更换阿里yum源
  11. 编程语言:8086汇编中int 16h接收alt+方向键
  12. android数据线投屏电视机,手机连接电视机的办法很多,连接效果也有很大差异,下面为大家介绍...
  13. 张正友标定算法原理详解
  14. 使用SimpleEmail邮件发送之QQ邮箱
  15. Dynamics CRM 向视图列添加自定义图标和提示信息
  16. 中国石油大学《化工原理二》第三阶段在线作业
  17. spark和tez的区别
  18. SQL驱动限制,导致插入失败
  19. openSSH-NFS的工作模式
  20. there is no source code available for the current location 解决方法

热门文章

  1. vue中实现图片丶文件上传
  2. 视频教程-清华-尹成老师-Python爬虫day13-Python
  3. 最新网狐旗舰版整理、编译和搭建教程
  4. 关于Python虚拟环境与包管理你应该知道的事
  5. OpenCV学习(二十三) :模板匹配:matchTemplate(),minMaxLoc()
  6. Ubuntu10.04 硬盘安装
  7. 虚拟机Linux系统无法联网的解决方法
  8. Java基础之匿名内部类,匿名内部类是什么?为什么要用匿名内部类,匿名内部类详解。
  9. MySql基础篇——变量、流程控制与游标
  10. i7 10875h和i7 9750h对比差距大吗