I’d like to split my dbmail db into 50 dbs in the same mysql instance.  I’m 
going to do this since I think it will be trivial to move the largest db to 
another server when/if my current server runs low on disk space or CPU power.  
I figure “pre-sharding” the dbmail database is an okay thing to do if I am 
hoping my website needs to scale beyond a single instance of mysql.

Is the best way to implement this is to start 50 instances of the dbmail 
daemons (dbmail-lmtpd, dbmail-imapd, dbmail-pop3d) changing my init scripts to 
use -f and -p options to point to separate config files that listen on 
different ports and connect to different database names?

I would then have 150 dbmail processes running on the server.  I would then use 
nginx to reverse proxy for each incoming lmtp, imap, and pop3 connections to 
the proper port (having the nginx mail auth script lookup the dbmail listening 
port for the user)?  I’ve never proxied smtp using nginx   before, but I figure 
nginx can handle this task based on the destination address.  Is nginx able to 
proxy lmtp requests or do I need to configure postfix to use a script that I 
write to use the mail recipient address to determine the dbmail config file to 
use for delivery using dbmail-deliver?

Then, when I want to move one of the 50 dbs to another server, I only have to 
move the one db to the new server, edit the conf file that handles that db’s 
connections with the new dburi, and restart the dbmail daemons.

Is this the best way to “pre-shard” dbs?  Or, do something else?  Or, not a 
good idea at all...

Kevin

_______________________________________________
DBmail mailing list
[email protected]
http://mailman.fastxs.nl/cgi-bin/mailman/listinfo/dbmail

Reply via email to