I use an application that consumes inotify watches. I've already set
fs.inotify.max_user_watches=32768
in /etc/sysctl.conf
but last night the application stopped indexing unless I ran it manually, which leads me to suspect I am out of watches.
Since I don't know what the trade off is when I increase this number (does it consume more RAM?), I don't know if I should just increase this number, so I'd like to know if there's a way I can tell if it's using all these watches and what the tradeoffs might be for increasing it.
tail
with the -f
(follow) option on any old file, e.g. tail -f /var/log/dmesg
:
tail: cannot watch '/var/log/dmsg': No space left on device
For the curious: Why is tail a "telltail"?
strace tail -f ...
instead, and when it succeeds, it ends with: inotify_add_watch(4, "/var/log/dmesg", IN_MODIFY...) = 1
inotify_add_watch (4, "/ var / log / dmesg", IN_MODIFY ..) = -1 ENOSPC (장치에 남은 공간 없음)
짧은 대답 : 물론입니다. 원하는 경우 50 만 (524288)으로 곧바로 이동하십시오 ... 사용되는 추가 메모리 는 4GB 이상의 메모리가있는 최신 시스템에서 무시 해도 됩니다.
So, assuming you set the max at 524288, and all were used (improbable), you'd be using approx. 256MB/512MB of 32-bit/64-bit kernel memory
What's the max value? I guess none, in theory, as long as you have enough RAM. In practice, 524288 has been officially recommended by apps, and people have been setting it to 2 million, with the accompanying memory usage, of course.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다