素材巴巴 > 程序开发 >

External file changes sync may be slow: The current inotify(7) watch limit is too low. More details.

程序开发 2023-09-02 19:42:16

项目出现Inotify Watches Limit问题

创建一个文件夹没有反应,必须等很久或者关闭项目在打开项目才出现

更改文件后不更新,必须重启服务器才能够更新

可以查看当前设置

cat /proc/sys/fs/inotify/max_user_watches
 # 8192
 

/etc/sysctl.d文件夹下新建60-jetbrains.conf文件

sudo touch /etc/sysctl.d/60-jetbrains.conf
 

60-jetbrains.conf文件中添加下列内容

# Set inotify watch limit high enough for IntelliJ IDEA (PhpStorm, PyCharm, RubyMine, WebStorm).
 # Create this file as /etc/sysctl.d/60-jetbrains.conf (Debian, Ubuntu), and
 # run `sudo service procps start` or reboot.
 # Source: https://confluence.jetbrains.com/display/IDEADEV/Inotify+Watches+Limit
 # 
 # More information resources:
 # -$ man inotify # manpage
 # -$ man sysctl.conf # manpage
 # -$ cat /proc/sys/fs/inotify/max_user_watches # print current value in usefs.inotify.max_user_watches = 524288
 

重新启动systemd

sudo sysctl -p --system
 

重启IDE

参考文档https://robbinespu.github.io/eng/2018/08/25/slow_file_changes_sync_inotify_limits.html

具体截图

在这里插入图片描述
在这里插入图片描述


标签:

素材巴巴 Copyright © 2013-2021 http://www.sucaibaba.com/. Some Rights Reserved. 备案号:备案中。