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>DbEnv::set_mp_max_write()</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="memp.html" title="Chapter 9. The DbMpoolFile Handle" /> 11 <link rel="prev" href="mempset_mp_max_openfd.html" title="DbEnv::set_mp_max_openfd()" /> 12 <link rel="next" href="envset_mp_mmapsize.html" title="DbEnv::set_mp_mmapsize()" /> 13 </head> 14 <body> 15 <div class="navheader"> 16 <table width="100%" summary="Navigation header"> 17 <tr> 18 <th colspan="3" align="center">DbEnv::set_mp_max_write()</th> 19 </tr> 20 <tr> 21 <td width="20%" align="left"><a accesskey="p" href="mempset_mp_max_openfd.html">Prev</a> </td> 22 <th width="60%" align="center">Chapter 9. 23 The DbMpoolFile Handle 24 </th> 25 <td width="20%" align="right"> <a accesskey="n" href="envset_mp_mmapsize.html">Next</a></td> 26 </tr> 27 </table> 28 <hr /> 29 </div> 30 <div class="sect1" lang="en" xml:lang="en"> 31 <div class="titlepage"> 32 <div> 33 <div> 34 <h2 class="title" style="clear: both"><a id="mempset_mp_max_write"></a>DbEnv::set_mp_max_write()</h2> 35 </div> 36 </div> 37 </div> 38 <pre class="programlisting">#include <db_cxx.h> 39 40int 41DbEnv::set_mp_max_write(int maxwrite, db_timeout_t maxwrite_sleep); </pre> 42 <p> 43 The <code class="methodname">DbEnv::set_mp_max_write()</code> method limits the number of sequential 44 write operations scheduled by the library when flushing dirty pages 45 from the cache. 46 </p> 47 <p> 48 The database environment's maximum number of sequential write 49 operations may also be configured using the environment's <a href="../../programmer_reference/env_db_config.html#env_db_config.DB_CONFIG" class="olink">DB_CONFIG</a> file. The 50 syntax of the entry in that file is a single line with the string 51 "set_mp_max_write", one or more whitespace characters, and the maximum 52 number of sequential writes and the number of microseconds to sleep, 53 also separated by whitespace characters. Because the <a href="../../programmer_reference/env_db_config.html#env_db_config.DB_CONFIG" class="olink">DB_CONFIG</a> file is 54 read when the database environment is opened, it will silently 55 overrule configuration done before that time. 56 </p> 57 <p> 58 The <code class="methodname">DbEnv::set_mp_max_write()</code> method configures a database 59 environment, not only operations performed using the specified 60 <a class="link" href="env.html" title="Chapter 5. The DbEnv Handle">DbEnv</a> handle. 61 </p> 62 <p> 63 The <code class="methodname">DbEnv::set_mp_max_write()</code> <span> 64 65 <span> 66 method either returns a non-zero error value or throws an 67 exception that encapsulates a non-zero error value on 68 failure, and returns 0 on success. 69 </span> 70 </span> 71 </p> 72 <div class="sect2" lang="en" xml:lang="en"> 73 <div class="titlepage"> 74 <div> 75 <div> 76 <h3 class="title"><a id="id1693039"></a>Parameters</h3> 77 </div> 78 </div> 79 </div> 80 <div class="sect3" lang="en" xml:lang="en"> 81 <div class="titlepage"> 82 <div> 83 <div> 84 <h4 class="title"><a id="id1693040"></a>maxwrite</h4> 85 </div> 86 </div> 87 </div> 88 <p> 89 The maximum number of sequential write operations scheduled by the 90 library when flushing dirty pages from the cache, or 0 if there is no 91 limitation on the number of sequential write operations. 92 </p> 93 </div> 94 <div class="sect3" lang="en" xml:lang="en"> 95 <div class="titlepage"> 96 <div> 97 <div> 98 <h4 class="title"><a id="id1693199"></a>maxwrite_sleep</h4> 99 </div> 100 </div> 101 </div> 102 <p> 103 The number of microseconds the thread of control should pause before 104 scheduling further write operations. It must be specified as an 105 unsigned 32-bit number of microseconds, limiting the maximum pause to 106 roughly 71 minutes. 107 </p> 108 </div> 109 </div> 110 <div class="sect2" lang="en" xml:lang="en"> 111 <div class="titlepage"> 112 <div> 113 <div> 114 <h3 class="title"><a id="id1693162"></a>Errors</h3> 115 </div> 116 </div> 117 </div> 118 <p> 119 The <code class="methodname">DbEnv::set_mp_max_write()</code> <span> 120 121 <span> 122 method may fail and throw a <a class="link" href="dbexception.html" title="Chapter 6. The DbException Class">DbException</a> 123 exception, encapsulating one of the following non-zero errors, or return one 124 of the following non-zero errors: 125 </span> 126 </span> 127 </p> 128 <div class="sect3" lang="en" xml:lang="en"> 129 <div class="titlepage"> 130 <div> 131 <div> 132 <h4 class="title"><a id="id1692806"></a>EINVAL</h4> 133 </div> 134 </div> 135 </div> 136 <p> 137 An invalid flag value or parameter was specified. 138 </p> 139 </div> 140 </div> 141 <div class="sect2" lang="en" xml:lang="en"> 142 <div class="titlepage"> 143 <div> 144 <div> 145 <h3 class="title"><a id="id1693409"></a>Class</h3> 146 </div> 147 </div> 148 </div> 149 <p> 150 <a class="link" href="env.html" title="Chapter 5. The DbEnv Handle">DbEnv</a>, <a class="link" href="memp.html" title="Chapter 9. The DbMpoolFile Handle">DbMpoolFile</a> 151 </p> 152 </div> 153 <div class="sect2" lang="en" xml:lang="en"> 154 <div class="titlepage"> 155 <div> 156 <div> 157 <h3 class="title"><a id="id1692804"></a>See Also</h3> 158 </div> 159 </div> 160 </div> 161 <p> 162 <a class="xref" href="memp.html#memplist" title="Memory Pools and Related Methods">Memory Pools and Related Methods</a> 163 </p> 164 </div> 165 </div> 166 <div class="navfooter"> 167 <hr /> 168 <table width="100%" summary="Navigation footer"> 169 <tr> 170 <td width="40%" align="left"><a accesskey="p" href="mempset_mp_max_openfd.html">Prev</a> </td> 171 <td width="20%" align="center"> 172 <a accesskey="u" href="memp.html">Up</a> 173 </td> 174 <td width="40%" align="right"> <a accesskey="n" href="envset_mp_mmapsize.html">Next</a></td> 175 </tr> 176 <tr> 177 <td width="40%" align="left" valign="top">DbEnv::set_mp_max_openfd() </td> 178 <td width="20%" align="center"> 179 <a accesskey="h" href="index.html">Home</a> 180 </td> 181 <td width="40%" align="right" valign="top"> DbEnv::set_mp_mmapsize()</td> 182 </tr> 183 </table> 184 </div> 185 </body> 186</html> 187