I have a Mailcow server which only has around 30 mailboxes on it at the moment and some users (an organisation which uses Thunderbird) have been complaining that they are getting "unable to connect to your IMAP server, maximum number of connections exceeded messages", in the dovecot-mailcow logs there are over 100 lines like this:
dovecot-mailcow_1 | Jul 11 12:16:31 webarch dovecot: imap([email protected]): Warning: Inotify instance limit for user 5000 (UID vmail) exceeded, disabling. Increase /proc/sys/fs/inotify/max_user_instances
I found this thread which suggests:
Please append settings below in
/etc/sysctl.conf:fs.inotify.max_user_instances=256 fs.inotify.max_user_watches=256Then run command
sysctl -pto load new settings.
It appears that the current value is 128:
docker-compose exec dovecot-mailcow bash
cat /proc/sys/fs/inotify/max_user_instances
128
The container doesn't have a /etc/sysctl.conf, how best to increase this in a persistent manner?
Thanks to @andryyy helping out in IRC this has been addressed by adding the following to /etc/sysctl.conf on the host server:
fs.inotify.max_user_watches = 4096
fs.inotify.max_user_instances = 4096
Checking it with:
sysctl -p
fs.inotify.max_user_watches = 4096
fs.inotify.max_user_instances = 4096
And restarting the Dovecot container and checking it there:
docker-compose restart dovecot-mailcow
docker-compose exec dovecot-mailcow bash
cat /proc/sys/fs/inotify/max_user_instances
4096
cat /proc/sys/fs/inotify/max_user_watches
4096
exit
I wonder if this would be worth adding to the common problems page, or somewhere else in the docs?
Most helpful comment
Thanks to @andryyy helping out in IRC this has been addressed by adding the following to
/etc/sysctl.confon the host server:Checking it with:
And restarting the Dovecot container and checking it there:
I wonder if this would be worth adding to the common problems page, or somewhere else in the docs?