| 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>set_cachesize</title> |
| 7 | <link rel="stylesheet" href="apiReference.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 C++ API Reference" /> |
| 10 | <link rel="up" href="configuration_reference.html" title="Appendix B. DB_CONFIG Parameter Reference" /> |
| 11 | <link rel="prev" href="repmgr_site_parameter.html" title="repmgr_site" /> |
| 12 | <link rel="next" href="set_cache_max_parameter.html" title="set_cache_max" /> |
| 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">set_cachesize</th> |
| 22 | </tr> |
| 23 | <tr> |
| 24 | <td width="20%" align="left"><a accesskey="p" href="repmgr_site_parameter.html">Prev</a> </td> |
| 25 | <th width="60%" align="center">Appendix B. DB_CONFIG Parameter Reference</th> |
| 26 | <td width="20%" align="right"> <a accesskey="n" href="set_cache_max_parameter.html">Next</a></td> |
| 27 | </tr> |
| 28 | </table> |
| 29 | <hr /> |
| 30 | </div> |
| 31 | <div class="sect1" lang="en" xml:lang="en"> |
| 32 | <div class="titlepage"> |
| 33 | <div> |
| 34 | <div> |
| 35 | <h2 class="title" style="clear: both"><a id="set_cachesize_parameter"></a>set_cachesize</h2> |
| 36 | </div> |
| 37 | </div> |
| 38 | </div> |
| 39 | <p> |
| 40 | Sets the size of the shared memory buffer pool — that is, the cache. |
| 41 | The cache should be the size of the normal working data set of the |
| 42 | application, with some small amount of additional memory for unusual |
| 43 | situations. (Note: the working set is not the same as the number of |
| 44 | pages accessed simultaneously, and is usually much larger.) |
| 45 | </p> |
| 46 | <p> |
| 47 | The value specified for this parameter is the |
| 48 | <span class="emphasis"><em>maximum</em></span> value that your application |
| 49 | will be able to use for your in-memory cache. If your |
| 50 | application does not have enough data to fill up the amount |
| 51 | of space specified here, then your application will only |
| 52 | use the amount of memory required by the data that your |
| 53 | application does have. |
| 54 | </p> |
| 55 | <p> |
| 56 | For the DB, the default cache size is 8MB. You cannot specify a |
| 57 | cache size value of less than 100KB. |
| 58 | </p> |
| 59 | <p> |
| 60 | Any cache size less than 500MB is automatically increased |
| 61 | by 25% to account for cache overhead; cache sizes larger |
| 62 | than 500MB are used as specified. The maximum size of a |
| 63 | single cache is 4GB on 32-bit systems and 10TB on 64-bit |
| 64 | systems. (All sizes are in powers-of-two, that is, 256KB |
| 65 | is 2^18 not 256,000.) |
| 66 | </p> |
| 67 | <p> |
| 68 | It is possible to specify cache sizes large enough they |
| 69 | cannot be allocated contiguously on some architectures. For example, |
| 70 | some releases of Solaris limit the amount of memory that may be |
| 71 | allocated contiguously by a process. If <span class="bold"><strong>ncache</strong></span> is 0 or 1, the cache will be allocated |
| 72 | contiguously in memory. If it is greater than 1, the cache will be |
| 73 | split across <span class="bold"><strong>ncache</strong></span> separate regions, |
| 74 | where the <span class="bold"><strong>region size</strong></span> is equal to the |
| 75 | initial cache size divided by <span class="bold"><strong>ncache</strong></span>. |
| 76 | </p> |
| 77 | <p> |
| 78 | The cache size supplied to this parameter will be |
| 79 | rounded to the nearest multiple of the region size and may not |
| 80 | be larger than the maximum possible cache size configured for your |
| 81 | application (use the |
| 82 | <a class="xref" href="set_cache_max_parameter.html" title="set_cache_max">set_cache_max</a> |
| 83 | to do this). The <span class="bold"><strong>ncache</strong></span> |
| 84 | parameter is ignored when resizing the cache. |
| 85 | </p> |
| 86 | <p> |
| 87 | The syntax of this parameter in the <a href="../../programmer_reference/env_db_config.html#env_db_config.DB_CONFIG" class="olink">DB_CONFIG</a> file is a |
| 88 | single line with the string |
| 89 | <code class="literal">set_cachesize</code>, one or more whitespace |
| 90 | characters, and the initial cache size specified in three |
| 91 | parts: the gigabytes of cache, the additional bytes of |
| 92 | cache, and the number of caches, also separated by |
| 93 | whitespace characters. For example: |
| 94 | </p> |
| 95 | <pre class="programlisting">set_cachesize 2 524288000 1</pre> |
| 96 | <p> |
| 97 | Creates a single 2.5GB physical cache. |
| 98 | </p> |
| 99 | <p> |
| 100 | Note that this parameter is ignored unless it is specified |
| 101 | before you initially create your environment, or you |
| 102 | re-create your environment after changing it. |
| 103 | </p> |
| 104 | <p> |
| 105 | For more information, see |
| 106 | <a class="xref" href="envset_cachesize.html" title="DbEnv::set_cachesize()">DbEnv::set_cachesize()</a>. |
| 107 | </p> |
| 108 | </div> |
| 109 | <div class="navfooter"> |
| 110 | <hr /> |
| 111 | <table width="100%" summary="Navigation footer"> |
| 112 | <tr> |
| 113 | <td width="40%" align="left"><a accesskey="p" href="repmgr_site_parameter.html">Prev</a> </td> |
| 114 | <td width="20%" align="center"> |
| 115 | <a accesskey="u" href="configuration_reference.html">Up</a> |
| 116 | </td> |
| 117 | <td width="40%" align="right"> <a accesskey="n" href="set_cache_max_parameter.html">Next</a></td> |
| 118 | </tr> |
| 119 | <tr> |
| 120 | <td width="40%" align="left" valign="top">repmgr_site </td> |
| 121 | <td width="20%" align="center"> |
| 122 | <a accesskey="h" href="index.html">Home</a> |
| 123 | </td> |
| 124 | <td width="40%" align="right" valign="top"> set_cache_max</td> |
| 125 | </tr> |
| 126 | </table> |
| 127 | </div> |
| 128 | </body> |
| 129 | </html> |