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