summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Cahill <michael.cahill@wiredtiger.com>2014-08-11 14:35:39 +1000
committerMichael Cahill <michael.cahill@wiredtiger.com>2014-08-11 14:35:39 +1000
commit23f3141eb5f561ac315b7474e7236b4124f66bb3 (patch)
treedf6851c12ae68c2aef8febe047d5eaa43bf380c2
parentb81279f3c1758ce78cadf86250b2b159ceecd37c (diff)
downloadmongo-23f3141eb5f561ac315b7474e7236b4124f66bb3.tar.gz
Move the new eviction settings into a group. We can transition older settings into the group in the next major release: that will break existing applications.
-rw-r--r--api/leveldb/leveldb_wt.h7
-rw-r--r--dist/api_data.py24
-rw-r--r--src/config/config_def.c42
-rw-r--r--src/conn/conn_cache.c8
-rw-r--r--src/docs/tune-cache.dox12
-rw-r--r--src/docs/upgrading.dox6
-rw-r--r--src/include/wiredtiger.in38
7 files changed, 75 insertions, 62 deletions
diff --git a/api/leveldb/leveldb_wt.h b/api/leveldb/leveldb_wt.h
index 0d169f81782..5e18346ce3b 100644
--- a/api/leveldb/leveldb_wt.h
+++ b/api/leveldb/leveldb_wt.h
@@ -45,9 +45,10 @@
#include "wiredtiger.h"
#define WT_URI "table:data"
-#define WT_CONN_CONFIG "log=(enabled),checkpoint=(wait=180),checkpoint_sync=false," \
- "session_max=8192,mmap=false,eviction_workers=4," \
- "transaction_sync=(enabled=true,method=none),"
+#define WT_CONN_CONFIG \
+ "log=(enabled),checkpoint=(wait=180),checkpoint_sync=false," \
+ "session_max=8192,mmap=false," \
+ "transaction_sync=(enabled=true,method=none),"
// Note: LSM doesn't split, build full pages from the start
#define WT_TABLE_CONFIG "type=lsm,split_pct=100,leaf_item_max=1KB," \
"lsm=(chunk_size=100MB,bloom_config=(leaf_page_max=8MB)),"
diff --git a/dist/api_data.py b/dist/api_data.py
index 3f0fabdc3b9..45b2655d8f0 100644
--- a/dist/api_data.py
+++ b/dist/api_data.py
@@ -340,16 +340,20 @@ connection_runtime_config = [
Config('eviction_trigger', '95', r'''
trigger eviction when the cache is using this much memory, as a
percentage of the total cache size''', min=10, max=99),
- Config('eviction_thread_max', '3', r'''
- maximum number of threads WiredTiger will start to help
- evict pages from cache. The number of threads currently running
- will vary depending on the current eviction load''',
- min=1, max=20),
- Config('eviction_thread_min', '1', r'''
- minimum number of threads WiredTiger will start to help evict
- pages from cache. The number of threads currently running will
- vary depending on the current eviction load''',
- min=1, max=20),
+ Config('eviction', '', r'''
+ eviction configuration options.''',
+ type='category', subconfig=[
+ Config('threads_max', '3', r'''
+ maximum number of threads WiredTiger will start to help
+ evict pages from cache. The number of threads currently running
+ will vary depending on the current eviction load''',
+ min=1, max=20),
+ Config('threads_min', '1', r'''
+ minimum number of threads WiredTiger will start to help evict
+ pages from cache. The number of threads currently running will
+ vary depending on the current eviction load''',
+ min=1, max=20),
+ ]),
Config('shared_cache', '', r'''
shared cache configuration options. A database should configure
either a cache_size or a shared_cache not both''',
diff --git a/src/config/config_def.c b/src/config/config_def.c
index 1b688384286..52b4199ee0a 100644
--- a/src/config/config_def.c
+++ b/src/config/config_def.c
@@ -49,6 +49,12 @@ static const WT_CONFIG_CHECK confchk_checkpoint_subconfigs[] = {
{ NULL, NULL, NULL, NULL }
};
+static const WT_CONFIG_CHECK confchk_eviction_subconfigs[] = {
+ { "threads_max", "int", "min=1,max=20", NULL },
+ { "threads_min", "int", "min=1,max=20", NULL },
+ { NULL, NULL, NULL, NULL }
+};
+
static const WT_CONFIG_CHECK confchk_shared_cache_subconfigs[] = {
{ "chunk", "int", "min=1MB,max=10TB", NULL },
{ "name", "string", NULL, NULL },
@@ -72,10 +78,9 @@ static const WT_CONFIG_CHECK confchk_connection_reconfigure[] = {
{ "checkpoint", "category", NULL,
confchk_checkpoint_subconfigs },
{ "error_prefix", "string", NULL, NULL },
+ { "eviction", "category", NULL, confchk_eviction_subconfigs },
{ "eviction_dirty_target", "int", "min=10,max=99", NULL },
{ "eviction_target", "int", "min=10,max=99", NULL },
- { "eviction_thread_max", "int", "min=1,max=20", NULL },
- { "eviction_thread_min", "int", "min=1,max=20", NULL },
{ "eviction_trigger", "int", "min=10,max=99", NULL },
{ "shared_cache", "category", NULL,
confchk_shared_cache_subconfigs },
@@ -297,10 +302,9 @@ static const WT_CONFIG_CHECK confchk_wiredtiger_open[] = {
"choices=[\"checkpoint\",\"data\",\"log\"]",
NULL },
{ "error_prefix", "string", NULL, NULL },
+ { "eviction", "category", NULL, confchk_eviction_subconfigs },
{ "eviction_dirty_target", "int", "min=10,max=99", NULL },
{ "eviction_target", "int", "min=10,max=99", NULL },
- { "eviction_thread_max", "int", "min=1,max=20", NULL },
- { "eviction_thread_min", "int", "min=1,max=20", NULL },
{ "eviction_trigger", "int", "min=10,max=99", NULL },
{ "exclusive", "boolean", NULL, NULL },
{ "extensions", "list", NULL, NULL },
@@ -372,12 +376,11 @@ static const WT_CONFIG_ENTRY config_entries[] = {
{ "connection.reconfigure",
"async=(enabled=0,ops_max=1024,threads=2),cache_size=100MB,"
"checkpoint=(name=\"WiredTigerCheckpoint\",wait=0),error_prefix=,"
- "eviction_dirty_target=80,eviction_target=80,"
- "eviction_thread_max=3,eviction_thread_min=1,eviction_trigger=95,"
- "shared_cache=(chunk=10MB,name=,reserve=0,size=500MB),"
- "statistics=none,statistics_log=(on_close=0,"
- "path=\"WiredTigerStat.%d.%H\",sources=,"
- "timestamp=\"%b %d %H:%M:%S\",wait=0),verbose=",
+ "eviction=(threads_max=3,threads_min=1),eviction_dirty_target=80,"
+ "eviction_target=80,eviction_trigger=95,shared_cache=(chunk=10MB,"
+ "name=,reserve=0,size=500MB),statistics=none,"
+ "statistics_log=(on_close=0,path=\"WiredTigerStat.%d.%H\","
+ "sources=,timestamp=\"%b %d %H:%M:%S\",wait=0),verbose=",
confchk_connection_reconfigure
},
{ "cursor.close",
@@ -483,16 +486,15 @@ static const WT_CONFIG_ENTRY config_entries[] = {
"async=(enabled=0,ops_max=1024,threads=2),buffer_alignment=-1,"
"cache_size=100MB,checkpoint=(name=\"WiredTigerCheckpoint\","
"wait=0),checkpoint_sync=,create=0,direct_io=,error_prefix=,"
- "eviction_dirty_target=80,eviction_target=80,"
- "eviction_thread_max=3,eviction_thread_min=1,eviction_trigger=95,"
- "exclusive=0,extensions=,file_extend=,hazard_max=1000,"
- "log=(archive=,enabled=0,file_max=100MB,path=\"\"),lsm_merge=,"
- "mmap=,multiprocess=0,session_max=100,shared_cache=(chunk=10MB,"
- "name=,reserve=0,size=500MB),statistics=none,"
- "statistics_log=(on_close=0,path=\"WiredTigerStat.%d.%H\","
- "sources=,timestamp=\"%b %d %H:%M:%S\",wait=0),"
- "transaction_sync=(enabled=0,method=fsync),use_environment_priv=0"
- ",verbose=",
+ "eviction=(threads_max=3,threads_min=1),eviction_dirty_target=80,"
+ "eviction_target=80,eviction_trigger=95,exclusive=0,extensions=,"
+ "file_extend=,hazard_max=1000,log=(archive=,enabled=0,"
+ "file_max=100MB,path=\"\"),lsm_merge=,mmap=,multiprocess=0,"
+ "session_max=100,shared_cache=(chunk=10MB,name=,reserve=0,"
+ "size=500MB),statistics=none,statistics_log=(on_close=0,"
+ "path=\"WiredTigerStat.%d.%H\",sources=,"
+ "timestamp=\"%b %d %H:%M:%S\",wait=0),transaction_sync=(enabled=0"
+ ",method=fsync),use_environment_priv=0,verbose=",
confchk_wiredtiger_open
},
{ NULL, NULL, NULL }
diff --git a/src/conn/conn_cache.c b/src/conn/conn_cache.c
index 2b7ccdfc79c..ac594d3aa88 100644
--- a/src/conn/conn_cache.c
+++ b/src/conn/conn_cache.c
@@ -60,13 +60,13 @@ __wt_cache_config(WT_CONNECTION_IMPL *conn, const char *cfg[])
* the difference when parsing the configuration.
*/
if ((ret = __wt_config_gets(
- session, cfg, "eviction_thread_max", &cval)) == 0) {
+ session, cfg, "eviction.threads_max", &cval)) == 0) {
WT_ASSERT(session, cval.val > 0);
conn->evict_workers_max = (u_int)cval.val - 1;
}
WT_RET_NOTFOUND_OK(ret);
if ((ret = __wt_config_gets(
- session, cfg, "eviction_thread_min", &cval)) == 0) {
+ session, cfg, "eviction.threads_min", &cval)) == 0) {
WT_ASSERT(session, cval.val > 0);
conn->evict_workers_min = (u_int)cval.val - 1;
}
@@ -74,8 +74,8 @@ __wt_cache_config(WT_CONNECTION_IMPL *conn, const char *cfg[])
if (conn->evict_workers_min > conn->evict_workers_max)
WT_RET_MSG(session, EINVAL,
- "eviction_thread_min cannot be greater than "
- "eviction_thread_max");
+ "eviction(threads_min) cannot be greater than "
+ "eviction(threads_max)");
return (0);
}
diff --git a/src/docs/tune-cache.dox b/src/docs/tune-cache.dox
index e4ec15f2f16..5f1e2c060c3 100644
--- a/src/docs/tune-cache.dox
+++ b/src/docs/tune-cache.dox
@@ -59,12 +59,12 @@ By default, WiredTiger cache eviction is handled by a single, separate
thread. In a large, busy cache, a single thread will be insufficient
(especially when the eviction thread must wait for I/O). Further, if
the eviction thread falls behind, application threads will be taken and
-used for eviction, potentially resulting in latency spikes. The \c
-eviction_thread_min and \c eviction_thread_max configuration values can
-be used to configure the number of threads WiredTiger can use to keep
-up with the application eviction load. If WiredTiger eviction threads
-are unable to evict enough space in the cache to keep up with
-application demand, application threads will be do eviction as well.
+used for eviction, potentially resulting in latency spikes. The
+\c eviction(threads_min) and \c eviction(threads_max) configuration values
+can be used to configure the number of threads WiredTiger can use to keep
+up with the application eviction load. If WiredTiger eviction threads are
+unable to evict enough space in the cache to keep up with application
+demand, application threads will be do eviction as well.
@snippet ex_all.c Eviction worker configuration
diff --git a/src/docs/upgrading.dox b/src/docs/upgrading.dox
index ba95cb48637..1a210d386b3 100644
--- a/src/docs/upgrading.dox
+++ b/src/docs/upgrading.dox
@@ -6,9 +6,9 @@
<dt>::wiredtiger_open eviction_workers configuration changed</dt>
<dd>
The \c eviction_workers configuration setting has been replaced by
-\c eviction_thread_min and \c eviction_thread_max settings. To
-replicate the old default behavior set both \c eviction_thread_min and
-\c eviction_thread_max to 1.
+\c eviction(threads_min) and \c eviction(threads_max) settings. To
+replicate the old default behavior set
+<code>eviction(threads_min=1,threads_max=1)</code>.
There is also a semantic change \c eviction_workers used to configure
additional threads whereas the new settings configure the total number
diff --git a/src/include/wiredtiger.in b/src/include/wiredtiger.in
index fb04c4743d4..d5da1249457 100644
--- a/src/include/wiredtiger.in
+++ b/src/include/wiredtiger.in
@@ -1518,6 +1518,17 @@ struct __wt_connection {
* @config{ ),,}
* @config{error_prefix, prefix string for error messages., a string;
* default empty.}
+ * @config{eviction = (, eviction configuration options., a set of
+ * related configuration options defined below.}
+ * @config{&nbsp;&nbsp;&nbsp;&nbsp;threads_max, maximum number of
+ * threads WiredTiger will start to help evict pages from cache. The
+ * number of threads currently running will vary depending on the
+ * current eviction load., an integer between 1 and 20; default \c 3.}
+ * @config{&nbsp;&nbsp;&nbsp;&nbsp;threads_min, minimum number of
+ * threads WiredTiger will start to help evict pages from cache. The
+ * number of threads currently running will vary depending on the
+ * current eviction load., an integer between 1 and 20; default \c 1.}
+ * @config{ ),,}
* @config{eviction_dirty_target, continue evicting until the cache has
* less dirty memory than the value\, as a percentage of the total cache
* size. Dirty pages will only be evicted if the cache is full enough
@@ -1526,14 +1537,6 @@ struct __wt_connection {
* total memory than the value\, as a percentage of the total cache
* size. Must be less than \c eviction_trigger., an integer between 10
* and 99; default \c 80.}
- * @config{eviction_thread_max, maximum number of threads WiredTiger
- * will start to help evict pages from cache. The number of threads
- * currently running will vary depending on the current eviction load.,
- * an integer between 1 and 20; default \c 3.}
- * @config{eviction_thread_min, minimum number of threads WiredTiger
- * will start to help evict pages from cache. The number of threads
- * currently running will vary depending on the current eviction load.,
- * an integer between 1 and 20; default \c 1.}
* @config{eviction_trigger, trigger eviction when the cache is using
* this much memory\, as a percentage of the total cache size., an
* integer between 10 and 99; default \c 95.}
@@ -1839,6 +1842,17 @@ struct __wt_connection {
* "log"; default empty.}
* @config{error_prefix, prefix string for error messages., a string; default
* empty.}
+ * @config{eviction = (, eviction configuration options., a set of related
+ * configuration options defined below.}
+ * @config{&nbsp;&nbsp;&nbsp;&nbsp;threads_max, maximum number of threads
+ * WiredTiger will start to help evict pages from cache. The number of threads
+ * currently running will vary depending on the current eviction load., an
+ * integer between 1 and 20; default \c 3.}
+ * @config{&nbsp;&nbsp;&nbsp;&nbsp;threads_min, minimum number of threads
+ * WiredTiger will start to help evict pages from cache. The number of threads
+ * currently running will vary depending on the current eviction load., an
+ * integer between 1 and 20; default \c 1.}
+ * @config{ ),,}
* @config{eviction_dirty_target, continue evicting until the cache has less
* dirty memory than the value\, as a percentage of the total cache size. Dirty
* pages will only be evicted if the cache is full enough to trigger eviction.,
@@ -1846,14 +1860,6 @@ struct __wt_connection {
* @config{eviction_target, continue evicting until the cache has less total
* memory than the value\, as a percentage of the total cache size. Must be
* less than \c eviction_trigger., an integer between 10 and 99; default \c 80.}
- * @config{eviction_thread_max, maximum number of threads WiredTiger will start
- * to help evict pages from cache. The number of threads currently running will
- * vary depending on the current eviction load., an integer between 1 and 20;
- * default \c 3.}
- * @config{eviction_thread_min, minimum number of threads WiredTiger will start
- * to help evict pages from cache. The number of threads currently running will
- * vary depending on the current eviction load., an integer between 1 and 20;
- * default \c 1.}
* @config{eviction_trigger, trigger eviction when the cache is using this much
* memory\, as a percentage of the total cache size., an integer between 10 and
* 99; default \c 95.}