fs.inotify.max_user_watches默认值太小,导致too many open files

运行环境:centos7.5

linux 打开文件数 too many open files 解决方法
fs.inotify.max_user_watches默认值太小,导致too many open files
执行:sysctl -w fs.inotify.max_user_watches="99999999"(后面值根据实际情况可自行调整)
查询是否生效:cat /proc/sys/fs/inotify/max_user_watches

永久生效方法如下:(建议采用此方法)
vim /etc/sysctl.conf
fs.inotify.max_user_watches = 1280000(后面值根据实际情况可自行调整)

fs.inotify.max_user_instances = 512
添加并运行/sbin/sysctl -p即可 

原文地址:https://www.cnblogs.com/caidingyu/p/10436560.html