Fs.inotify.max_user_watches default value is too small to cause too many open files

Source: Internet
Author: User
Tags inotify

See too many open files may think of fs.file-max parameters, in fact, also affected by the following parameters:

  1. Fs.inotify.max_queued_events: Represents the maximum value assigned to the number of events that can be queued in inotify instance when Inotify_init is called, an event that exceeds this value is discarded, but triggers a in_q_ Overflow event.

  2. Fs.inotify.max_user_instances: Represents the maximum number of inotify instatnces that each real user ID can create, by default 128.

  3. Fs.inotify.max_user_watches: Represents the number of watch that the same user can add at the same time (watch is generally for the directory, which determines the number of directories that the same user can monitor)

  4. To view system default parameter values:

  5. [[Email protected] ~] #sysctl-A | grep max_queued_events

  6. fs.inotify.max_queued_events= 16384

  7. [[Email protected] ~] #sysctl-A | grep max_user_watches

  8. fs.inotify.max_user_watches= 8192

  9. fs.epoll.max_user_watches= 201707

  10. [[Email protected] ~] #sysctl-A | grep max_user_instances

  11. fs.inotify.max_user_instances= 128


It is recommended that you modify the system default parameters as follows (vi/etc/sysctl.conf):

  1. fs.inotify.max_user_instances=8192

  2. Or

  3. Vim/etc/sysctl.conf

  4. fs.inotify.max_queued_events= 99999999

  5. fs.inotify.max_user_watches= 99999999

  6. fs.inotify.max_user_instances= 65535

Note: max_queued_events is the maximum length of the queue that INotify manages, and the more frequently the file system changes, the greater the value should be. If you see the event Queue Overflow in the log, it means that max_queued_events is too small to adjust the parameters again so


This article comes from "? Only! "Blog, be sure to keep this provenance http://renzhiyuan.blog.51cto.com/10433137/1775347

Fs.inotify.max_user_watches default value is too small to cause too many open files

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.