[Dovecot] Can`t get over 1024 processes

Timo Sirainen tss at iki.fi
Mon Sep 17 18:45:05 EEST 2012


On 17.9.2012, at 18.26, Timo Sirainen wrote:

> It doesn't work like that with Dovecot. ulimit -u 8192 must be run just before dovecot binary is started. ulimits elsewhere are irrelevant.


Although the strange thing is that Dovecot v2.1 is supposed to automatically increase this limit at startup. Maybe FreeBSD does work in a different way than Linux? The way Linux works (and Dovecot assumes things work) is:

1. dovecot master process starts, inheriting the ulimits from the shell that starts it
2. Dovecot checks the current limit and increases it if necessary
3. Forked child processes inherit the parent's ulimits
4. setuid(X) fails if UID X has reached the ulimit value (according the current process's ulimit - not some other value read from somewhere)

There is no reading of X's ulimit value anywhere, it's the same for all Dovecot child processes. limits.conf and such are read and applied by PAM, which is done before 1 step.

kern.maxprocperuid I guess means the upper allowed limit for the ulimit.




More information about the dovecot mailing list