tail: inotify cannot be used, reverting to polling: Too many open files
Run Code Online (Sandbox Code Playgroud)
我在 Ubuntu (AWS ec2) 上运行 apache 和 tomcat 服务器。每当我尝试catalina.out跟踪 tomcat 时,我都会收到太多打开的文件。但是我可以使用 vi 查看它。
在互联网上搜索后,我尝试了以下命令:
lsof | awk '{ print $2; }' | sort -rn | uniq -c | sort -rn | head
Run Code Online (Sandbox Code Playgroud)
结果如下
17 5650
17 5178
13 5972
10 5976
10 5974
9 5977
9 5975
9 5973
8 5978
4 9
Run Code Online (Sandbox Code Playgroud)
当我运行 lsof 进程 ids 时:5650 是 bash,5178 又是 bash,其他人是 sshd、top 和 apache2。
为什么会有大量 …