Re: IMAPD-SSL - too many open files

Sam Varshavchik <[email protected]> Tue, 27 May 2025 21:18:31 -0400
Newsgroups gmane.mail.imap.courier.general
Message-ID <[email protected]>
keithw--- via courier-users writes:

> After about an hour or two, I start getting this in the logs and then IMAP  
> stops working for everyone.
>
> May 20 01:02:45 smtp imapd-ssl[9428]: .: Too many open files
> May 20 01:02:45 smtp imapd-ssl[9428]: This may be a problem with FAM or Gamin
> May 20 01:02:45 smtp imapd-ssl[9428]: Failed to create cache file:  
> maildirwatch ([email protected])
> May 20 01:02:45 smtp imapd-ssl[9428]: Error: Too many open files

Irrespective of anything else, one part of the above message is obsolete,  
and needs to be adjusted.

> A simple restart of courier and the problem is gone.
>
> Currently I have a crontab restarting courier hourly and generally it gets  
> us by, but sometimes it doesn't.
>
> Here are some relevant info on open file ulimits.
>
> root@smtp:/etc/courier# cat /proc/sys/fs/file-max
> 9223372036854775807
>
> root@smtp:/etc/courier# cat /proc/sys/fs/file-nr
> 6752    0       9223372036854775807

What about /proc/sys/fs/inode-nr and /proc/sys/fs/nr-open ?

https://docs.kernel.org/admin-guide/sysctl/fs.html

> I have a feeling the message is wrong and this is some sort of leak.

Well, one part of the verbiage is wrong, but that is not relevant here.
But this sounds more like some resource is being exhausted.

On the assumption that this is a file descriptor leak, see if anything  
stands out from:

ls -d /proc/*/fd/* | cut -d/ -f1-4 | sort | uniq -c | sort -n

This counts the number of files opened by each process in the system, and  
sorts the list by number of files.

_______________________________________________
courier-users mailing list
[email protected]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users
signature.asc (application/pgp-signature, 228 B)
-----BEGIN PGP SIGNATURE-----

iHUEABYKAB0WIQRupkKLJP96aW75pIOKYPgoojZS4gUCaDZkZwAKCRCKYPgoojZS
4t+FAP9HStR5SpAhKOyfOqFoDepN/d1aozKSbyBWU5X/tOd1TQD/ZbK5RrH52/8s
xZXLdXhQ5SD6/8EcBNQRAi6cLfKCQgQ=
=XSA0
-----END PGP SIGNATURE-----