最新消息:

inotify 事件丢失的那点事

inotify admin 5181浏览 0评论

inotify 事件丢失的那点事_黑色星期五_新浪博客

昨儿个同事让我帮其解决他一直悬而不决的inotify丢事件的问题,我下面是我对inotify参数调整的理解
fs.inotify.max_user_instances = 128
fs.inotify.max_user_watches = 8192000
fs.inotify.max_queued_events = 1638400
      /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_OVER-FLOW event is always generated.
              这个参数很重要决定了对应的inotify实例监控事件队列大小,如果对应的inotify实例的监控的并发事件很高,那么需要加大这个值,不然就会丢事件

      /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.
             同一用户同时可以创建的inotify实例数
      /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.
              同一用户同时可以添加的watch数目(watch一般是针对目录,决定了同时同一用户可以监控的目录数量)

转载请注明:爱开源 » inotify 事件丢失的那点事

您必须 登录 才能发表评论!