ulimit -n vs client_limit vs process_limit
As many of my users are accessing their mail remotely, I've seen service loads increase and came across this log messages which I haven't seen before
imap-login: Error: socketpair() failed: Too many open files: user=<*>, ...
I gather I have to increase file descriptor limits, which is currently set to match
default_client_limit = 1000
What should I set "ulimit -n" relative to client_limit? Or perhaps I've roofed
service imap-login {
process_limit = 2
...
}
and should adjust that?
Joseph Tam <jtam.home@gmail.com>
You need to adjust LimitNOFiles (or ulimit -n). Dovecot needs more file descriptors than just the ones used by imap-login process, so it is a good idea to consider setting it to at least 3x time the value.
Aki
On 17/12/2020 04:57 Joseph Tam <jtam.home@gmail.com> wrote:
As many of my users are accessing their mail remotely, I've seen service loads increase and came across this log messages which I haven't seen before
imap-login: Error: socketpair() failed: Too many open files: user=<*>, ...
I gather I have to increase file descriptor limits, which is currently set to match
default_client_limit = 1000
What should I set "ulimit -n" relative to client_limit? Or perhaps I've roofed
service imap-login { process_limit = 2 ... }
and should adjust that?
Joseph Tam <jtam.home@gmail.com>
On Thu, 17 Dec 2020, Aki Tuomi wrote:
What should I set "ulimit -n" relative to client_limit? Or perhaps I've roofed
You need to adjust LimitNOFiles (or ulimit -n). Dovecot needs more file descriptors than just the ones used by imap-login process, so it is a good idea to consider setting it to at least 3x time the value.
Thanks, good to know.
Out of curiosity, I did a snapshot of FD usage for dovecot's supervisory processes:
# for p in imap-login config log auth pop3-login stats dovecot anvil; do
# echo "$p \c"; ls /proc/`pgrep -f /$p`/fd | wc -l
# done
imap-login 357
config 14
log 38
auth 22
pop3-login 20
stats 193
dovecot 221
anvil 18
I guess "dovecot" or "stat" are the particular processes that needs to have FD limits set larger than to the sum of client_limits.
Joseph Tam <jtam.home@gmail.com>
participants (3)
-
Aki Tuomi
-
Jens Urban
-
Joseph Tam