Project sponsored by



Project hosted on

SourceForge Logo



The BDBHPT driver was developed during the performance testing. The original BDB driver provided better performance than all of the other drivers, but still did not provide the level of performance that I expected. By profiling the original BDB driver, I determined that the BDB join function was an extremely expensive operation. The only way to eliminate this operation was to design a new database structure that did not require the join. Furthermore, the database needed to remain as small as possible while also providing all the same features as the rest of the DLZ drivers.

A great deal of time was spent testing, developing and profiling this driver. The absolute best database structure was developed through this time consuming process. The only potential "performance killer" left in this driver is the query time conversion of text to Bind's data structures, but this is necessary for any driver which stores its data as text.

Unlike the original BDB driver, this driver supports three modes of operation. Each mode provides a different level of features and performance. The Transactional mode is the most featureful but also the slowest, and in that mode of operation it is still 4 to 5 times faster than the original BDB driver. The original BDB driver only uses the concurrent data store capability of BDB. When the BDBHPT driver operates in that mode, it can be almost 9 times faster than the original driver. In private mode, BDBHPT is up to 12 times faster and provides performance that is very close to an unmodified Bind with its in-memory only design.

After mode (Transactional, Concurrent, Private), the next most important setting for optimum performance is the BDB cache size. This is controlled by a DB_CONFIG file in the BDB's environment directory. For more information, refer to the BDB documentation. For all tests a BDB cache size of 832MB was used. This provided the best performance by providing the highest cache hit rate, while also not causing virtual memory disk swapping.

A sample of the configuration for each of the modes is included below. If you want to change from one mode to another, you do not need to recreate the entire database, just the environment. The easiest way to do that is to delete all the files that begin with two dashes in the BDB environment directory, "rm __*" while the DNS server is stopped. Then edit the DLZ configuration to use the new mode, and then start Bind. The DLZ driver will recreate the environment files using the new mode you selected. When operating in "private" mode, no environment files are created.

# Transactional mode

dlz "bdb zone" {
   database "bdbhpt t /dns_data/ext3/bdb_hpt dns_data.db";
};
# Concurrent mode

dlz "bdb zone" {
   database "bdbhpt c /dns_data/ext3/bdb_hpt dns_data.db";
};
# Private mode

dlz "bdb zone" {
   database "bdbhpt p /dns_data/ext3/bdb_hpt dns_data.db";
};

This driver provides the highest performance of all the DLZ drivers. Unless there is a compelling reason to use another driver, I highly recommend that this driver be used in any production scenario over any of the other available drivers.