How to adjust inotify instances limit?

Q: I get new error in logs.

Apr 10 08:50:26 imap(secretariat@ceae.info): Warning: Inotify instance limit for user 5000 (UID vmail) exceeded, disabling. Increase /proc/sys/fs/inotify/max_user_instances

How we get solutions on this ?

A: Now we have:

[root@mail ~]# cat /proc/sys/fs/inotify/max_user_instances
128

Imap connections are:

[root@mail ~]# ss -tnp state established src \*:993 ‘||’ src \*:143 | wc -l
182

We have to increase the maximum number of instances:

echo "fs.inotify.max_user_instances = 1024" >>/etc/sysctl.conf
sysctl -p

Enjoy, that it is!

Source: http://dev.nethserver.org/issues/2850