[Dovecot] Too many open files

Daniel Cox danielcox at adam.com.au
Thu Jan 4 08:57:14 UTC 2007


I am running Dovecot 1.0rc15 on NetBSD 3.1 with only a few connections.
It is built from pkgsrc-2006Q3, with mail/dovecot/ updated to HEAD.
kqueue is a default build option - I haven't tried without yet.

Mail directories/indexes are on a Linux 2.6.16.29 NFS file system, I
have set these options and it performs well:
mmap_disable=yes
lock_method=fcntl
FYI. rc7 had very high CPU use with the same options, which rc15 seems
to have fixed :-)

I also have this problem with dovecot-nightly-20060225 (1.0beta3) on
NetBSD 2.1RC3 using a local ffs file system.

This appears in /var/log/maillog:
Jan  4 18:44:42 server dovecot: pipe() failed: Too many open files

# ps ax|grep dovecot
  723 ??  Ss    2:14.15 /usr/pkg/sbin/dovecot
  822 ??  S     0:07.79 dovecot-auth
# sysctl proc.723.rlimit
proc.723.rlimit.descriptors.soft = 64
proc.723.rlimit.descriptors.hard = 1772

If I change /etc/login.conf to contain:
-----
default|default class:\
        :openfiles-max=2048:\
        :openfiles-cur=1024:
-----
Then login as root and /etc/rc.d/dovecot restart, the new soft limit is
applied which helps but only delays the error. I haven't worked out how
to make this happen automatically on restart.
NOTE: hard never goes above kern.maxfiles which is 1772 (I think the
kernel needs to be recompiled to increase further).

proc.21494.rlimit.descriptors.soft = 1024
proc.21494.rlimit.descriptors.hard = 1772

# fstat -p 21494
root     dovecot    21494   45* pipe 0xcc4e0138 <- 0xcc4e0648 rn

Shows an increasing number of pipe files open.

This NetBSD 3.1 system is a test server which I can experiment with if
there is anything further I can do to help find the problem.

Thank you,
Daniel.



More information about the dovecot mailing list