2016.11.8
Brother K has 2 servers using the Unison+inotify to reach the site folder synchronization effect
Today suddenly found that inotify occupy a large CPU, you can use the top command to view
Open the INotify log to see why
Find this error
Failed to Watch/opt; Upper limit on inotify watches reached!
Please increase the amount of inotify watches allowed per user via '/proc/sys/fs/inotify/max_user_watches '.
The main idea: inotify the number of default monitoring synchronization files is limited, 8192, through the configuration file/proc/sys/fs/inotify/max_user_watches can adjust the number of monitoring
My problem is obviously that the file is increasing, which makes it impossible to monitor more files.
Cat this file, the default value is 8192,
echo 8192000 >>/proc/sys/fs/inotify/max_user_watches
Finally, there is a little hint, 2 servers, this setting not the same
It's better to be a little bigger, another small one, like 8200000.
If set to the same, it is likely to cause 2 server CPUs to rise at the same time, leading to business terminal, Brother K
This article is from the "kevinzhang91" blog, make sure to keep this source http://kevinzhang91.blog.51cto.com/12012510/1870596
INotify error failed to watch/opt; Brother/proc/sys/fs/inotify/max_user_watches,k