On Monday 07 June 2004 2:01 pm, Jeremy Kitchen wrote: > On Monday 07 June 2004 01:39 pm, Martin Leduc wrote: > > Can you tel me quickly what is the difference between > > enabled-many-domain=y and =n? > > as far as I know it only affects sql (mysql only?) backends, as with > --enable-many-domains=y (default) it uses one table with all of the > information, and with it =n it uses one table per domain. > > Someone who has actually dug through the code (Tom?, Michael?, Ken?) might > be able to give you a more definite example, but from my experience that's > the main difference. > > I think --enable-large-site (or similar) is what enables/disables the > directory hashing, but don't quote me on that.
As an ex-database admin, I wrote the many-domains=no option as an optimization to the database schema to save disk space. Consider hosting one domain with 1 million email accounts. The pw_domain(64 char) field is redundant (only one domain). So we would be wasting 64MB of space in the database. So instead the table is named after the domain. On the other hand, consider hosting 700 domains. Mysql would have to access 700 tables. Mysql uses file descriptors for each table. In production, we saw mysql opening and closing file descriptors as it tried to share it's available file descriptors across sql queries, which seriously impacted performance. On this type of system, it we got better performance by putting all the data into one table. The end result after performance testing was the single table setup was the best for all servers, except for the case where there are 1 (or a few) domains with many-many email accounts. Hence we made "many domains" the default option. Ken Jones