[Dovecot] service_count=0 for imap and pop3

Mark Moseley moseleymark at gmail.com
Sat Nov 13 00:51:33 EET 2010


>> Only potential problem is memory leaks that keep increasing the memory usage. Of course there should be no memory leaks. :) You could anyway set something like service_count=1000 to get it to restart after handling 1000 connections.
>
> I'll keep that one in mind. Doesn't seem like it could hurt to have
> something like =1000 just to be safe.
>
> For anybody else reading this thread, here's vmstat from two boxes
> with an almost identical amount of IMAP and POP3 connections, but the
> first example has "service_count=0" for "service pop3", the second
> doesn't. Check out the context switches (this will paste horribly;
> it's the 5th column from the right):
>
> With "service_count=0":
>  r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa
>  0  0      0  54056 161536 1116012    0    0   132     0 1326 7868  3  8 85  4
>  0  0      0  53568 161608 1116192    0    0   116     0 1572 5111  2  6 80 13
>  1  0      0  52320 161608 1116960    0    0    16   140 1584 6126  3  6 86  5
>  0  0      0  51940 161656 1117292    0    0    44   128 1430 5508  3  7 86  5
>  0  0      0  53316 161628 1115500    0    0    12     0 1459 5363  4  7 86  4
>  0  0      0  52176 161664 1115468    0    0    76    76 1221 6344  6  5 84  6
>  0  1      0  52300 161688 1115636    0    0    32     0 1250 3631  3  2 90  6
>  0  0      0  53580 161648 1113116    0    0    76   172 1778 6671  3  9 83  6
>
> Without "service_count=0":
>  r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa
>  0  2   2476  73776 147860 958728    0    0     0     0  912 17442  6 11  0 84
>  0  2   2476  61300 147860 958756    0    0     0     0  992 22130  5 19  0 76
> 21  4   2476  49484 148008 957608    0    0   140   748 2472 15922  9 24  0 68
> 30  4   2476  97928 146604 945232    0    0   404     0 7116 20700 43 58  0  0
>  4  1   2476 169280 146700 946972    0    0   172     0 7014 43727 33 67  1  0
>  7  1   2476 168684 146800 947304    0    0   168     0 5720 55485 37 62  2  1
>  9  0   2476 165956 146856 947504    0    0    80     0 5074 56371 35 65  0  0
>  6  6   2476 163032 146948 948380    0    0    92  2432 5879 63418 27 67  5  2
>
> It's nice to look at 'perf top' on the first box and not see
> "finish_task_switch" chewing up 15+% of kernel CPU time :)
>

Timo,
Any hints on how many POP3 and IMAP connections I'd be able to get
away with in a single threads with the above setup, assuming they're
relative busy? I.e. if my boxes typically have, say, 200 concurrent
POP3 connections and 600 IMAP connections, if I used
process_min_avail=50 for POP3 and process_min_avail=100 for IMAP, I'd
assume that'd be in the area of 4 POP3 concurrent connections handled
by that one POP3 thread and 6 concurrent connections handled by that
one IMAP thead.

I was thinking something like 3-4 per thread (calculating vs max
connections) for POP3 and maybe 5-7 for IMAP (as I'm assuming that at
least a few will just be in IDLE at any given point).

I guess it comes down to, are you aware of any internal limits for a
POP3 or IMAP thread where they're going to start to bog down and
possibly death spiral? I'm going to experiment with different
settings, but I'd love to hear any opinions you have on it. Sorry for
the vagueness.

BTW, I realize process_min_avail is just a minimum, but without having
service_count=1, what would cause dovecot to fork off more processes
than #process_min_avail?

Thanks!


More information about the dovecot mailing list