标签:
碰到一台机器,不管是哪个分区,tail -f 文件就会提示如下,less不会有问题,tail -10 也没问题
tail: cannot watch `/www/log/a.com.log‘: No space left on device
tail: cannot watch ` /var/log/messagess‘: No space left on device
df -Th df -i 都不是磁盘满的原因
后面咨询同行,没几分钟就把问题解决了,备忘一下。
根据服务器性能调整参数
/etc/sysctl.conf
fs.inotify.max_user_watches = 65536
cat /proc/sys/fs/inotify/max_user_watches
后面自己找了下资料,怀疑应该是内存不够导致OOM(阿里云一台低配机器,阿里云好像有做什么操作可以防止OOM?)有点混乱,大家自己找原因吧。
http://unix.stackexchange.com/questions/13751/kernel-inotify-watch-limit-reached
https://bugzilla.redhat.com/show_bug.cgi?id=894483
Each used inotify watch takes up 540 bytes (32-bit system), or 1 kB (double - on 64-bit) [sources:1, 2]
This comes out of kernel memory, which is unswappable.
Assuming you set the max at 524288 and all were used (improbable), you‘d be using approximately 256MB/512MB of 32-bit/64-bit kernel memory.
Note that your application will also use additional memory to keep track of the inotify handles, file/directory paths, etc. -- how much depends on its design
标签:
原文地址:http://my.oschina.net/longquan/blog/410739