inotifywait upper limit on inotify watches reached!

Failed to watch /xxx/xx/; upper limit on inotify watches reached!
Please increase the amount of inotify watches allowed per user via `/proc/sys/fs/inotify/max_user_watches’.

fs.inotify.max_user_watches:表示同一用户同时可以添加的watch数目(watch一般是针对目录,决定了同时同一用户可以监控的目录数量)

建议修改系统默认参数,方法如下(vi /etc/sysctl.conf):

fs.inotify.max_user_instances=8192

注意: max_queued_events 是inotify管理的队列的最大长度,文件系统变化越频繁,这个值就应该越大。如果你在日志中看到Event Queue Overflow,说明max_queued_events太小需要调整参数后再次使用。

关于重启inotify配置max_user_watches无效被恢复默认值8192的正确修改方法

一般网上修改方法就是直接修改文件:

/proc/sys/fs/inotify/max_user_watches

或者修改方法:

sysctl -w fs.inotify.max_user_watches=”99999999″

但是这些修改后,Linux系统重启inotify配置max_user_watches无效被恢复默认值8192,这个可能很多的新手不是很明白,这个不详细讲解,有空大家去了解下:sysctl

Linux系统重启inotify配置max_user_watches无效被恢复默认值8192的正确修改方法为:

vim /etc/sysctl.conf 

注意添加的内容:

fs.inotify.max_user_watches=99999999(你想设置的值)

原文链接:https://blog.csdn.net/weiguang1017/article/details/54381439