[Dovecot] And again... too many open files
Hi!
Two days ago I upgraded to 1.2.15, and again I the warning
"Warning: fd limit 1024 is lower than what Dovecot can use under full load"
reappeared.
It's a bit weird, because my actual limits are higher. From /etc/security/limits.conf
soft nofile 4096
root soft nofile 4096 root hard nofile 8192 dovecot soft nofile 4096 dovecot hard nofile 8192hard nofile 8192
I added the * lines to avoid problems if a new user was involved, and finally supposed it was a bug in the detection process.
Today, as expected, dovecot was not responding with the famous "Too many open files" error. Has something changed? Is there some way to know which is the maximum number of files that can be open? Is there some parameter I can change to avoid this?
Here's my dovecot -n
# 1.2.15: /usr/local/etc/dovecot.conf # OS: Linux 2.6.18-164.11.1.el5 x86_64 Red Hat Enterprise Linux Server release 5.4 (Tikanga) syslog_facility: local1 protocols: imap imaps pop3 pop3s listen(default): *:143 listen(imap): *:143 listen(pop3): *:110 ssl_listen(default): *:993 ssl_listen(imap): *:993 ssl_listen(pop3): *:995 ssl_cert_file: /usr/share/ssl/certs/imapd.pem ssl_key_file: /usr/share/ssl/certs/imapd.pem disable_plaintext_auth: no login_dir: /usr/local/var/run/dovecot/login login_executable(default): /usr/local/libexec/dovecot/imap-login login_executable(imap): /usr/local/libexec/dovecot/imap-login login_executable(pop3): /usr/local/libexec/dovecot/pop3-login login_process_per_connection: no login_process_size: 256 login_processes_count: 16 login_max_processes_count: 256 login_max_connections: 512 max_mail_processes: 2048 first_valid_uid: 100 mail_location: maildir:~/Maildir:INDEX=/var/dovecot/%u:CONTROL=/var/dovecot nas/%u/control mail_nfs_storage: yes lock_method: dotlock mail_executable(default): /usr/local/libexec/dovecot/imap mail_executable(imap): /usr/local/libexec/dovecot/imap mail_executable(pop3): /usr/local/libexec/dovecot/pop3 mail_plugins(default): quota imap_quota mail_plugins(imap): quota imap_quota mail_plugins(pop3): quota mail_plugin_dir(default): /usr/local/lib/dovecot/imap mail_plugin_dir(imap): /usr/local/lib/dovecot/imap mail_plugin_dir(pop3): /usr/local/lib/dovecot/pop3 pop3_uidl_format(default): %08Xu%08Xv pop3_uidl_format(imap): %08Xu%08Xv pop3_uidl_format(pop3): %v.%u auth default: cache_size: 1000 cache_ttl: 6000 master_user_separator: * debug: yes passdb: driver: passwd-file args: /usr/local/etc/bloqueados deny: yes passdb: driver: ldap args: /usr/local/etc/dovecot-ldap.conf passdb: driver: passwd-file args: /usr/local/etc/shadow passdb: driver: pam passdb: driver: passwd-file args: /usr/local/etc/dovecot-master.conf master: yes userdb: driver: prefetch userdb: driver: passwd-file args: /usr/local/etc/passwd userdb: driver: ldap args: /usr/local/etc/dovecot-ldap.conf socket: type: listen master: path: /var/run/dovecot/auth-master mode: 384 plugin: quota: fs
Joseba Torre. Vicegerencia de TICs, área de Explotación
On Wed, 2010-10-06 at 10:34 +0200, Joseba Torre wrote:
"Warning: fd limit 1024 is lower than what Dovecot can use under full load"
reappeared.
It's a bit weird, because my actual limits are higher. From /etc/security/limits.conf
These limits don't affect Dovecot at all, because they're for users that are actually logging in (via PAM). System services get their limits elsewhere.
# OS: Linux 2.6.18-164.11.1.el5 x86_64 Red Hat Enterprise Linux Server release
I don't really know what the correct place to put it would be in RHEL. One way at least that might work (I'm not sure) would be to put
ulimit -n 4096
to /etc/sysconfig/dovecot
On Miércoles 06 Octubre 2010 16:11:27 Timo Sirainen escribió:
These limits don't affect Dovecot at all, because they're for users that are actually logging in (via PAM). System services get their limits elsewhere.
Ops! I thought limits.conf was a semi-official answer for this issue. But you're right, I've been playing with it and looking at /proc/$PID/limits and it has no influence. It works for initial dovecot process (run by root), but not for the imap-login or pop3-login ones.
One way at least that might work (I'm not sure) would be to put
ulimit -n 4096
to /etc/sysconfig/dovecot
Unfortunately, this doesn't work with my home made startup script.
Anyway, on a testing machine I've seen that the actual limit depends on the configuration file (¿?). The initial limit was 533, and after adding the following lines to dovecot.conf
login_processes_count = 16 login_max_connections = 512 login_process_size = 256
now it's 1045.
Any ideas?
Joseba Torre. Vicegerencia de TICs, área de Explotación
On Wed, 2010-10-06 at 16:58 +0200, Joseba Torre wrote:
On Miércoles 06 Octubre 2010 16:11:27 Timo Sirainen escribió:
These limits don't affect Dovecot at all, because they're for users that are actually logging in (via PAM). System services get their limits elsewhere.
Ops! I thought limits.conf was a semi-official answer for this issue. But you're right, I've been playing with it and looking at /proc/$PID/limits and it has no influence. It works for initial dovecot process (run by root),
Really? It does change it then. Maybe the "*" line? I'm pretty sure the "dovecot" lines don't..
but not for the imap-login or pop3-login ones.
That's because these processes calculate the max. number of needed fds and drops the limit automatically.
Are you actually seeing error messages about actually running of fds? I thought the problem was:
"Warning: fd limit 1024 is lower than what Dovecot can use under full load"
This is checked only at startup when running the master process. And if dovecot process's fd limit is higher than 1024, then I'd think this error message goes away?..
On Miércoles 06 Octubre 2010 17:11:49 Timo Sirainen escribió:
Ops! I thought limits.conf was a semi-official answer for this issue. But you're right, I've been playing with it and looking at /proc/$PID/limits and it has no influence. It works for initial dovecot process (run by root),
Really? It does change it then. Maybe the "*" line? I'm pretty sure the "dovecot" lines don't..
Sorry, I was confused. When started at boot, it doesn't affect, but when I do
# service dovecot restart
as root, the root lines apply.
but not for the imap-login or pop3-login ones.
That's because these processes calculate the max. number of needed fds and drops the limit automatically.
Are you actually seeing error messages about actually running of fds?
I got a lot of
dovecot: pipe() failed: Too many open files
until I restarted dovecot.
I
thought the problem was:
"Warning: fd limit 1024 is lower than what Dovecot can use under full load"
This is checked only at startup when running the master process. And if dovecot process's fd limit is higher than 1024, then I'd think this error message goes away?..
Finally, if changed my startup script adding
ulimit -n 4096
before
daemon /usr/local/sbin/dovecot
and the problem has disappeared.
Thanks!
Joseba Torre. Vicegerencia de TICs, área de Explotación
On 10/7/2010 10:16 AM, Joseba Torre wrote:
On Miércoles 06 Octubre 2010 17:11:49 Timo Sirainen escribió:
Ops! I thought limits.conf was a semi-official answer for this issue. But you're right, I've been playing with it and looking at /proc/$PID/limits and it has no influence. It works for initial dovecot process (run by root), Really? It does change it then. Maybe the "*" line? I'm pretty sure the "dovecot" lines don't.. Sorry, I was confused. When started at boot, it doesn't affect, but when I do
# service dovecot restart
as root, the root lines apply.
but not for the imap-login or pop3-login ones. That's because these processes calculate the max. number of needed fds and drops the limit automatically.
Are you actually seeing error messages about actually running of fds? I got a lot of
dovecot: pipe() failed: Too many open files
until I restarted dovecot.
I
thought the problem was:
"Warning: fd limit 1024 is lower than what Dovecot can use under full load" This is checked only at startup when running the master process. And if dovecot process's fd limit is higher than 1024, then I'd think this error message goes away?.. Finally, if changed my startup script adding
ulimit -n 4096
before
daemon /usr/local/sbin/dovecot
and the problem has disappeared.
Thanks!
To help out this thread, my redhat (centos 5.5) says: [root@mail ~]# ulimit unlimited [root@mail ~]#
This has never been changed by me and, so, I don't know why your redhat is coming default with a limit. You seem to not have changed it as you are baffled at why the limit is there. I'll try and figure out a permanent way for you to change it.
Jerrale G. SC Senior Admin
On Jueves 07 Octubre 2010 17:09:18 Jerrale G escribió:
To help out this thread, my redhat (centos 5.5) says: [root@mail ~]# ulimit unlimited [root@mail ~]#
This has never been changed by me and, so, I don't know why your redhat is coming default with a limit. You seem to not have changed it as you are baffled at why the limit is there. I'll try and figure out a permanent way for you to change it.
You should try with # ulimit -a
This will tell you the actual limits. ulimit alone tells the shell to go unlimited.
Joseba Torre. Vicegerencia de TICs, área de Explotación
participants (3)
-
Jerrale G
-
Joseba Torre
-
Timo Sirainen