[BlueOnyx:02266] Re: Dovecot issues?

Michael Stauber mstauber at blueonyx.it
Sun Aug 30 15:21:59 -05 2009


Hi Gregg,

> Recently I have noticed in the mail lot a lot of weird errors.
>
> dovecot: pop3-login: Can't connect to auth server at default: Too many open
> files
> dovecot: imap-login: socket(default) failed: Too many open files

I haven't seen this problem on any box yet, so I don't quite know why you're 
running into it.

What does "lsof -nu dovecot|wc -l" report at the time of the error?

That command shows how many files Dovecot has open.

There is a hard OS limit that limits how many files any given process may hold 
open. That limit is 1024 files and is defined on a kernel level.

Work around:

$ cd /proc/sys/kernel
$ echo "4096"  >file-max
$ echo "12288" >inode-max

That increases the maximum number of open files to 4096. But inode-max also 
needs to be increased. As a rule of the thumb it should be 3-4x higher than 
"file-max". These changes are only temporary until the next reboot. Unless you 
stuff them into a server startup script that gets executed when the server 
starts.

Alternatively a recompiled kernel can also fix this. In that case NR_FILE and 
NR_INODE in include/linux/fs.h need to be adjusted. But that shouldn't be 
necessary.

-- 
With best regards

Michael Stauber




More information about the Blueonyx mailing list