I am setting up a web server using Exim 4 on Debian 8 and, as usual, I was going to use MySQL as backend to store the settings related to the domains and users (like quota, emails, aliases, forwards, enabled/disabled account/domain, antispam/antivirus on/off, whitelist, blacklist and so on). At some point I stopped, using MySQL as backend for Exim 4 would simplify my life a lot but I think that it is not the best solution for performance.

There are consistent differences in terms of performance and/or resource consumption between using MySQL, SQLite, DBM or plain text files? For example, would be a good solution put a CDB or a DBM in a in-memory filesystem?

The load on the server will be very low, there will be more or less 50 websites with not more than 150/200 email accounts in total, so it doesn't really matter but I want to do some experiments and tests to find out the best possibility. For that reason I don't want to put the spool in memory, there would be very few emails.

I would like to do some tests but I have very little time right now, so any direct/indirect experience would be really appreciated!


MySQL backend is standard for most mail-related software that makes easy general tasks. For example, postfixadmin allow to maintain a lot of domains/users by number of admins. Then dovecot's auth service can use that database to fetch user's credentials. Also exim can use the same database for queries. As far as it has single maintenance point, the risk of failure is significantly lower than when you have homebrewed back end.

  • 1
    You are right, but my point was about performance because while Exim/Postfix/Dovecot support MySQL as backend, the MTAs (Exim/Postfix) need to do a many queries to deliver a single mail. For example, to know if the email account exists, if the domain exists, if the antispam/antivirus is enabled and so on. PS: cdb/dbm are not "homebrewed" backends, they are supported, they are faster than MySQL because there are less layers and, most important, they can be generated at service restart and/or after every change and put in a ram filesystem to push the performance. My question was about this :) – Daniele Salvatore Albano Jul 31 '15 at 5:35
  • 1
    MySQL effectively cached results, so real query will be performed only when db is updated. Cached data returned very fast, even faster then noncachd file-stored data – Kondybas Aug 8 '15 at 12:38
  • I have mail servers where thousands of accounts proceeded by single core CPU on the 1 GB of RAM. Exim/dovecot are not the resource eaters. – Kondybas Aug 8 '15 at 12:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.