1<!--$Id: memp_maxwrite.so,v 10.6 2007/11/08 16:28:12 bostic Exp $-->
2<!--Copyright (c) 1997,2008 Oracle.  All rights reserved.-->
3<!--See the file LICENSE for redistribution information.-->
4<html>
5<head>
6<title>Berkeley DB: DbEnv::set_mp_max_write</title>
7<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
8<meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++">
9</head>
10<body bgcolor=white>
11<table width="100%"><tr valign=top>
12<td>
13<b>DbEnv::set_mp_max_write</b>
14</td>
15<td align=right>
16<a href="/api_cxx/api_core.html"><img src="/images/api.gif" alt="API"></a>
17<a href="/ref/toc.html"><img src="/images/ref.gif" alt="Ref"></a></td>
18</tr></table>
19<hr size=1 noshade>
20<tt>
21<b><pre>
22#include &lt;db_cxx.h&gt;
23<p>
24int
25DbEnv::set_mp_max_write(int maxwrite, db_timeout_t maxwrite_sleep);
26<p>
27int
28DbEnv::get_mp_max_write(int *maxwritep, db_timeout_t *maxwrite_sleepp);
29</pre></b>
30<hr size=1 noshade>
31<b>Description: DbEnv::set_mp_max_write</b>
32<p>The DbEnv::set_mp_max_write method limits the number of sequential write
33operations scheduled by the library when flushing dirty pages from the
34cache.</p>
35<p>The database environment's maximum number of sequential write operations may also be configured using the
36environment's <a href="/ref/env/db_config.html#DB_CONFIG">DB_CONFIG</a> file.  The syntax of the entry in that
37file is a single line with the string "set_mp_max_write", one or more whitespace
38characters, and the maximum number of sequential writes and the number of microseconds
39to sleep, also separated by whitespace characters.
40Because the <a href="/ref/env/db_config.html#DB_CONFIG">DB_CONFIG</a> file is read when the database environment
41is opened, it will silently overrule configuration done before that
42time.</p>
43<p>The DbEnv::set_mp_max_write method configures a database environment, not only operations
44performed using the specified <a href="/api_cxx/env_class.html">DbEnv</a> handle.</p>
45<p>The DbEnv::set_mp_max_write method
46either returns a non-zero error value
47or throws an exception that encapsulates a non-zero error value on
48failure, and returns 0 on success.
49</p>
50<b>Parameters</b> <br>
51 <b>maxwrite</b><ul compact><li>The maximum number of sequential write operations scheduled by the
52library when flushing dirty pages from the cache, or 0 if there is
53no limitation on the number of sequential write operations.</ul>
54 <b>maxwrite_sleep</b><ul compact><li>The number of microseconds the thread of control should pause before
55scheduling further write operations.  It must be specified as an
56unsigned 32-bit number of microseconds, limiting the maximum pause to
57roughly 71 minutes.</ul>
58<br>
59<br><b>Errors</b>
60<p>The DbEnv::set_mp_max_write method
61may fail and throw
62<a href="/api_cxx/except_class.html">DbException</a>,
63encapsulating one of the following non-zero errors, or return one of
64the following non-zero errors:</p>
65<br>
66<b>EINVAL</b><ul compact><li>An
67invalid flag value or parameter was specified.</ul>
68<br>
69<hr size=1 noshade>
70<b>Description: DbEnv::get_mp_max_write</b>
71<p>The DbEnv::get_mp_max_write method returns the current maximum number of
72sequential write operations and microseconds to pause.</p>
73<p>The DbEnv::get_mp_max_write method may be called at any time during the life of the
74application.</p>
75<p>The DbEnv::get_mp_max_write method
76either returns a non-zero error value
77or throws an exception that encapsulates a non-zero error value on
78failure, and returns 0 on success.
79</p>
80<b>Parameters</b> <br>
81 <b>maxwritep</b><ul compact><li>The <b>maxwritep</b> parameter references memory into which
82 the maximum number of sequential write operations is copied.</ul> 
83 <b>maxwrite_sleepp</b><ul compact><li>The <b>maxwrite_sleepp</b> parameter references memory into which
84 the microseconds to pause before scheduling further write operations is copied.</ul> 
85<br>
86<hr size=1 noshade>
87<br><b>Class</b>
88<a href="/api_cxx/env_class.html">DbEnv</a>, <a href="/api_cxx/mempfile_class.html">DbMpoolFile</a>
89<br><b>See Also</b>
90<a href="/api_cxx/memp_list.html">Memory Pools and Related Methods</a>
91</tt>
92<table width="100%"><tr><td><br></td><td align=right>
93<a href="/api_cxx/api_core.html"><img src="/images/api.gif" alt="API"></a><a href="/ref/toc.html"><img src="/images/ref.gif" alt="Ref"></a>
94</td></tr></table>
95<p><font size=1>Copyright (c) 1996,2008 Oracle.  All rights reserved.</font>
96</body>
97</html>
98