Berkeley DB Reference Guide:
Logging Subsystem


Configuring logging

The aspects of logging that may be configured are the size of the logging subsystem's region, the size of the log files on disk and the size of the log buffer in memory. The DB_ENV->set_lg_regionmax method specifies the size of the logging subsystem's region, in bytes. The logging subsystem's default size is 60KB. This value may need to be increased if a large number of files are registered with the Berkeley DB log manager, for example, by opening a large number of Berkeley DB database files in a transactional application.

The DB_ENV->set_lg_max method specifies the individual log file size for all the applications sharing the Berkeley DB environment. Setting the log file size is largely a matter of convenience and a reflection of the application's preferences in backup media and frequency. However, setting the log file size too low can potentially cause problems because it would be possible to run out of log sequence numbers, which requires a full archival and application restart to reset. See Log file limits for more information.

The DB_ENV->set_lg_bsize method specifies the size of the in-memory log buffer, in bytes. Log information is stored in memory until the buffer fills up or transaction commit forces the buffer to be written to disk. Larger buffer sizes can significantly increase throughput in the presence of long-running transactions, highly concurrent applications, or transactions producing large amounts of data. By default, the buffer is 32KB.


Copyright (c) 1996-2005 Sleepycat Software, Inc. - All rights reserved.