See too many open files may think of fs.file-max parameters, in fact, also affected by the following parameters:
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.
Fs.inotify.max_user_instances: Represents the maximum number of inotify instatnces that each real user ID can create, by default 128.
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)
To view system default parameter values:
[[Email protected] ~] #sysctl-A | grep max_queued_events
fs.inotify.max_queued_events= 16384
[[Email protected] ~] #sysctl-A | grep max_user_watches
fs.inotify.max_user_watches= 8192
fs.epoll.max_user_watches= 201707
[[Email protected] ~] #sysctl-A | grep max_user_instances
fs.inotify.max_user_instances= 128
It is recommended that you modify the system default parameters as follows (vi/etc/sysctl.conf):
fs.inotify.max_user_instances=8192
Or
Vim/etc/sysctl.conf
fs.inotify.max_queued_events= 99999999
fs.inotify.max_user_watches= 99999999
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