On Sun, 2005-10-23 at 08:11 +0200, Mark Rosenstand wrote:
Hi list!
I'm a little confused. I have set "login_process_per_connection = yes" and "login_processes_count = 1", and this is how my pstree looks when nobody is connected:
dovecot -,- dovecot-auth `- imap-login
However, when I connect with a client it looks like this:
dovecot -,- dovecot-auth |- imap `- 2*[imap-login]
I would expect it to only have one imap-login running.
No. login_process_per_connection means that each incoming connection gets its own imap-login process. If the user happens to be using TLS/SSL, then the imap-login process doesn't die until the connection closes (since it's proxying the SSL connection).
Also login_process_count doesn't actually mean the maximum number of imap-login processes that can be waiting.. It's rather the minimum number of processes to use while everything is idling.
The actual rules go like this:
/* we want to respond fast when multiple clients are connecting
at once, but we also want to prevent fork-bombing. use the
same method as apache: check once a second if we need new
processes. if yes and we've used all the existing processes,
double their amount (unless we've hit the high limit).
Then for each second that didn't use all existing processes,
drop the max. process count by one. */
if (group->wanted_processes_count < group->set->login_processes_count) {
group->wanted_processes_count =
group->set->login_processes_count;
} else if (group->listening_processes == 0)
group->wanted_processes_count *= 2;
else if (group->wanted_processes_count >
group->set->login_processes_count)
group->wanted_processes_count--;
if (group->wanted_processes_count >
group->set->login_max_processes_count) {
group->wanted_processes_count =
group->set->login_max_processes_count;
}
In Dovecot 2.0 there will be a rewritten master process and its process creation rules are probably more easily understandable..