| 1 | <?xml version="1.0" encoding="UTF-8" standalone="no"?> |
| 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| 3 | <html xmlns="http://www.w3.org/1999/xhtml"> |
| 4 | <head> |
| 5 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
| 6 | <title>Configuring logging</title> |
| 7 | <link rel="stylesheet" href="gettingStarted.css" type="text/css" /> |
| 8 | <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /> |
| 9 | <link rel="start" href="index.html" title="Berkeley DB Programmer's Reference Guide" /> |
| 10 | <link rel="up" href="log.html" title="Chapter 17. The Logging Subsystem" /> |
| 11 | <link rel="prev" href="log.html" title="Chapter 17. The Logging Subsystem" /> |
| 12 | <link rel="next" href="log_limits.html" title="Log file limits" /> |
| 13 | </head> |
| 14 | <body> |
| 15 | <div xmlns="" class="navheader"> |
| 16 | <div class="libver"> |
| 17 | <p>Library Version 11.2.5.3</p> |
| 18 | </div> |
| 19 | <table width="100%" summary="Navigation header"> |
| 20 | <tr> |
| 21 | <th colspan="3" align="center">Configuring logging</th> |
| 22 | </tr> |
| 23 | <tr> |
| 24 | <td width="20%" align="left"><a accesskey="p" href="log.html">Prev</a> </td> |
| 25 | <th width="60%" align="center">Chapter 17. |
| 26 | The Logging Subsystem |
| 27 | </th> |
| 28 | <td width="20%" align="right"> <a accesskey="n" href="log_limits.html">Next</a></td> |
| 29 | </tr> |
| 30 | </table> |
| 31 | <hr /> |
| 32 | </div> |
| 33 | <div class="sect1" lang="en" xml:lang="en"> |
| 34 | <div class="titlepage"> |
| 35 | <div> |
| 36 | <div> |
| 37 | <h2 class="title" style="clear: both"><a id="log_config"></a>Configuring logging</h2> |
| 38 | </div> |
| 39 | </div> |
| 40 | </div> |
| 41 | <p>The aspects of logging that may be configured are the size of the |
| 42 | logging subsystem's region, the size of the log files on disk and the |
| 43 | size of the log buffer in memory. The <a href="../api_reference/C/envset_lg_regionmax.html" class="olink">DB_ENV->set_lg_regionmax()</a> method |
| 44 | specifies the size of the logging subsystem's region, in bytes. The |
| 45 | logging subsystem's default size is approximately 60KB. This value may |
| 46 | need to be increased if a large number of files are registered with the |
| 47 | Berkeley DB log manager, for example, by opening a large number of Berkeley DB |
| 48 | database files in a transactional application.</p> |
| 49 | <p>The <a href="../api_reference/C/envset_lg_max.html" class="olink">DB_ENV->set_lg_max()</a> method specifies the individual log file size for |
| 50 | all the applications sharing the Berkeley DB environment. Setting the log |
| 51 | file size is largely a matter of convenience and a reflection of the |
| 52 | application's preferences in backup media and frequency. However, |
| 53 | setting the log file size too low can potentially cause problems because |
| 54 | it would be possible to run out of log sequence numbers, which requires |
| 55 | a full archival and application restart to reset. See |
| 56 | <a class="xref" href="log_limits.html" title="Log file limits">Log file limits</a> for more |
| 57 | information.</p> |
| 58 | <p>The <a href="../api_reference/C/envset_lg_bsize.html" class="olink">DB_ENV->set_lg_bsize()</a> method specifies the size of the in-memory log |
| 59 | buffer, in bytes. Log information is stored in memory until the buffer |
| 60 | fills up or transaction commit forces the buffer to be written to disk. |
| 61 | Larger buffer sizes can significantly increase throughput in the |
| 62 | presence of long-running transactions, highly concurrent applications, |
| 63 | or transactions producing large amounts of data. By default, the buffer |
| 64 | is approximately 32KB.</p> |
| 65 | <p>The <a href="../api_reference/C/envset_lg_dir.html" class="olink">DB_ENV->set_lg_dir()</a> method specifies the directory in which |
| 66 | log files will be placed. By default, log files are placed in |
| 67 | the environment home directory.</p> |
| 68 | <p>The <a href="../api_reference/C/envset_lg_filemode.html" class="olink">DB_ENV->set_lg_filemode()</a> method specifies the absolute file mode for |
| 69 | created log files. This method is only useful for the rare Berkeley DB |
| 70 | application that does not control its umask value.</p> |
| 71 | <p>The <a href="../api_reference/C/envlog_set_config.html" class="olink">DB_ENV->log_set_config()</a> method configures several boolean parameters |
| 72 | that control the use of file system controls such as O_DIRECT and O_DSYNC, |
| 73 | automatic removal of log files, in-memory logging, and pre-zeroing of logfiles.</p> |
| 74 | </div> |
| 75 | <div class="navfooter"> |
| 76 | <hr /> |
| 77 | <table width="100%" summary="Navigation footer"> |
| 78 | <tr> |
| 79 | <td width="40%" align="left"><a accesskey="p" href="log.html">Prev</a> </td> |
| 80 | <td width="20%" align="center"> |
| 81 | <a accesskey="u" href="log.html">Up</a> |
| 82 | </td> |
| 83 | <td width="40%" align="right"> <a accesskey="n" href="log_limits.html">Next</a></td> |
| 84 | </tr> |
| 85 | <tr> |
| 86 | <td width="40%" align="left" valign="top">Chapter 17. |
| 87 | The Logging Subsystem |
| 88 | </td> |
| 89 | <td width="20%" align="center"> |
| 90 | <a accesskey="h" href="index.html">Home</a> |
| 91 | </td> |
| 92 | <td width="40%" align="right" valign="top"> Log file limits</td> |
| 93 | </tr> |
| 94 | </table> |
| 95 | </div> |
| 96 | </body> |
| 97 | </html> |