too many open files
linux 环境部署的java项目,其中采用 OKhttp发出请求,response已经在finally关闭后,仍然抛出异常“oo many open files”
原因: 句柄数达到了服务器的最大值
解决方案:
1. 查看线程占句柄数: ulint -a ,结果 open files(-n) 1024 代表每个句柄数
2.修改linux单进程最大文件链接数
修改linux参数, vi /etc/security/limts.conf
添加 : * soft nofile 65536
* hard nofile 65536
保存,注销当前用户,即可生效
浙公网安备 33010602011771号