Hitting wall at 2048 IMAP connections

Nick Edwards nick.z.edwards at gmail.com
Wed Feb 4 13:57:25 UTC 2015


The default connection limit values of dovecot are pathetic - unless
you run a home mail server where there is only you, the cat and the
dog using it.

OP, lots of editing with trial and error required.
from memory massive  increases needed to:

service auth  -> client limit
service imap-login  -> process limit
service imap -> process limit
 if using pop3, repeat above two steps s/imap/pop3/
service managesieve -> process limit
service anvil -> client_limit
(and system ulimit)

I'm on holidays in australia at moment so don't have access to copy
and show you a working example for 4K users, i will be back on hong
kong in 17 days until then i have very limited access.

On 2/4/15, Jiri Bourek <bourek at thinline.cz> wrote:
> On 02/03/2015 03:35 PM, Ron Cleven wrote:
>> We are gradually rolling out Dovecot (IMAP only, no POP3) to our
>> customer base.  We are replicating between a pair of CentOS 7 boxes. All
>> has been working wonderfully.  However, to be sure our rollout continues
>> to go smoothly, we put together a simple benchmark client program to
>> fire up X persistent IMAP connections (using hundreds of mailboxes) that
>> login, list the folders, select the INBOX, periodically FETCH an email
>> from the INBOX, and otherwise sit in an IDLE loop.  As long as we keep
>> the number of concurrent IMAP connections under 2k, everything works
>> fine.  2,000 processes generate a minimal load on the server.  However,
>> 2048 is a "hard limit" for number of IMAP processes on a box the way
>> things are configured right now.  The number (2048) is a bit too magical
>> to be anything but a misconfiguration of either some kernel limit or a
>> dovecot configuration limit.  I have been unable to figure out where
>> else to look.  I have pasted in my dovecot config below along with the
>> kernel  setting for max_user_instances.
>>
>> Hoping someone can tell me what stupid mistake I have made or what else
>> to check.
>>
>> Just an aside, we front-end this with a separate set of proxy servers
>> that provide an SSL front-end, hence, no SSL in the dovecot config.
>>
>
> You didn't mention but did you try checking process_limit and
> client_limit for various Dovecot services in the output of doveconf |
> less ? If I remember correctly, as long as imap process lives, it is a
> client of anvil process. When anvil reaches it's maximum, it's no longer
> possible to run more imap processes and therefore no longer possible to
> connect more clients.
>
> I think I hit some similar problem in the past, but in my case Dovecot
> complained during startup and warned that anvil's client_limit is too
> low compared to imap process_limit and that it could lead to problems.
> So I just increased the limit and was done with it.
>
> That said, this was some time ago so process and setting names can be
> completely wrong. Hope someone more knowledgeable corrects me in that case
>


More information about the dovecot mailing list