文件监视

fs.inotify.max_user_instances
fs.inotify.max_user_watches

定义了用户对 inotify 资源和 inotify 文件监视数量的限制。 如果达到这些限制,您可能会遇到进程失败并显示与限制相关的错误消息,例如:

ENOSPC: System limit for number of file watchers reached...
The configured user limit (128) on the number of inotify instances has been reached 
The default defined inotify instances (128) has been reached

查看限制

cat /proc/sys/fs/inotify/max_user_instances

cat /proc/sys/fs/inotify/max_user_watches

更改限制

sysctl fs.inotify.max_user_instances=8192
sysctl fs.inotify.max_user_watches=524288

sysctl -p

持久化修改

echo 'fs.inotify.max_user_instances=8192' >> /etc/sysctl.conf
echo 'fs.inotify.max_user_watches=524288' >> /etc/sysctl.conf