I don't understand the best way to set fs.inotify.max_user_watches
with sysctl
. In fact, I don't understand much of what is happening here other than the fact that I need to set the number of files that can be watched by a particular process.
I believe that I can see the max number of users by running this command:
cat /proc/sys/fs/inotify/max_user_watches
My understanding is that some people suggest changing /proc/sys/fs/inotify/max_user_watches
by opening /etc/sysctl.conf
in an editor and adding this to it:
fs.inotify.max_user_watches=524288
Then run sudo sysctl -p
to -- presumably -- process the changes made to the file.
Others suggest running commands like this:
sudo sysctl -w fs.inotify.max_user_instances=1024
sudo sysctl -w fs.inotify.max_user_watches=12288
I know that -w
stands for write, but what is being written and where? Is it just that this command changes /proc/.../max_user_watches
?
Which of the two approaches outlined above is best? I understand that 524288 and 12288 are different numbers, but I don't understand the difference between the effect of running -p
and -w
.