limit of inotify
来源:互联网 发布:深圳淘宝美工课程 编辑:程序博客网 时间:2024/06/18 12:25
本文可解决函数inotify_add_watch发生ENOSPC错误的问题。
-------------------------------------------------------------------------------------------
Problem
When dropbox or guard says like:
Unable to monitor filesystem Please run: echo 100000 | sudo tee /proc/sys/fs/inotify/max_user_watches and restart Dropbox to correct the problem.
No space left on device - Failed to watch "…": The user limit on the total number of inotify watches was reached or the kernel failed to allocate a needed resource. (Errno::ENOSPC)
Solution
man inotify(7) says:
The following interfaces can be used to limit the amount of kernel memory consumed by inotify:
/proc/sys/fs/inotify/max_queued_events
The value in this file is used when an application calls inotify_init(2) to set an upper limit on the number of events that can be queued to the corresponding inotify instance. Events in excess of this limit are dropped, but an IN_Q_OVERFLOW event is always generated.
/proc/sys/fs/inotify/max_user_instances
This specifies an upper limit on the number of inotify instances that can be created per real user ID.
/proc/sys/fs/inotify/max_user_watches
This specifies an upper limit on the number of watches that can be created per real user ID.
In this case, Dropbox and guard have to use many watches, so do this and increasemax_user_watches
.
# Check current maximum$ cat /proc/sys/fs/inotify/max_user_watches8192# Increase the maximum$ echo 100000|sudo tee /proc/sys/fs/inotify/max_user_watchesPassword:100000# Check$ cat /proc/sys/fs/inotify/max_user_watches100000
Doing the above increases max_user_watches
temporally.
To increase max_user_watches
at boot, edit /etc/sysctl.conf
and addfs.inotify.max_user_watches=100000
or fix fs.inotify.max_user_watches=
to100000
.
(Note: I’m using gentoo so some other distros may have another way to do this…)
本文转自:http://blog.sorah.jp/2012/01/24/inotify-limitation
- limit of inotify
- Android Studio Inotify Watches Limit
- inotify报错upper limit on inotify watches reached
- Inotify
- inotify
- Inotify
- inotify
- inotify
- inotify
- Inotify
- inotify
- inotify
- inotify
- inotify
- lots of "GET variable length limit exceeded"
- Limit of Eclipse Web Services Explorer
- Tkinter entry limit the length of input.
- LIMIT
- 使用Axis开发Web Service
- 二叉树遍历
- WP7访问云端数据的方式
- 实战:sqlserver 2008 R2容灾方案:另一种思路-2
- Oracle日期函数与应用
- limit of inotify
- 两种人
- 详解yii用户登录体系
- GetCurrentProcessID、OpenProcessToken、LookupPrivilegeValue、AdjustTokenPrivileges
- MFC Attach()函数和Detach()函数
- javascript 设计模式
- WORD中公式与正文对齐
- android.app.ServiceConnectionLeaked: that was originally bound here
- DWORD get_fattime()