summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Cahill <michael.cahill@mongodb.com>2015-12-08 14:21:57 +1100
committerMichael Cahill <michael.cahill@mongodb.com>2015-12-08 14:21:57 +1100
commit04e0c89bea319c981816cb4fdbc4347ff2e115ca (patch)
tree37e9d5934f5cbee22b54ceb3c27f2e9dfc53d91d
parentf1b011ab23909a291b53df3e4d651c276dfb601b (diff)
parent4c49043f5cd596042e49d6566858b9932e83a66e (diff)
downloadmongo-04e0c89bea319c981816cb4fdbc4347ff2e115ca.tar.gz
Merge branch 'develop' into 2.7.0_release
-rw-r--r--src/evict/evict_lru.c11
-rw-r--r--src/include/cache.h2
2 files changed, 11 insertions, 2 deletions
diff --git a/src/evict/evict_lru.c b/src/evict/evict_lru.c
index b5cb850d83c..5d1054e92b7 100644
--- a/src/evict/evict_lru.c
+++ b/src/evict/evict_lru.c
@@ -473,6 +473,15 @@ __evict_update_work(WT_SESSION_IMPL *session)
return (false);
/*
+ * Setup the number of refs to consider in each handle, depending
+ * on how many handles are open. We want to consider less candidates
+ * from each file as more files are open. Handle the case where there
+ * are no files open by adding 1.
+ */
+ cache->evict_max_refs_per_file =
+ WT_MAX(100, WT_MILLION / (conn->open_file_count + 1));
+
+ /*
* Page eviction overrides the dirty target and other types of eviction,
* that is, we don't care where we are with respect to the dirty target
* if page eviction is configured.
@@ -1216,7 +1225,7 @@ __evict_walk_file(WT_SESSION_IMPL *session, u_int *slotp)
evict < end && !enough && (ret == 0 || ret == WT_NOTFOUND);
ret = __wt_tree_walk(
session, &btree->evict_ref, &pages_walked, walk_flags)) {
- enough = pages_walked > WT_EVICT_MAX_PER_FILE;
+ enough = pages_walked > cache->evict_max_refs_per_file;
if ((ref = btree->evict_ref) == NULL) {
if (++restarts == 2 || enough)
break;
diff --git a/src/include/cache.h b/src/include/cache.h
index d8a3829863f..a0440f23a00 100644
--- a/src/include/cache.h
+++ b/src/include/cache.h
@@ -14,7 +14,6 @@
pages by this many increments of the
read generation. */
#define WT_EVICT_WALK_PER_FILE 10 /* Pages to queue per file */
-#define WT_EVICT_MAX_PER_FILE 100 /* Max pages to visit per file */
#define WT_EVICT_WALK_BASE 300 /* Pages tracked across file visits */
#define WT_EVICT_WALK_INCR 100 /* Pages added each walk */
@@ -107,6 +106,7 @@ struct __wt_cache {
uint32_t evict_slots; /* LRU list eviction slots */
WT_DATA_HANDLE
*evict_file_next; /* LRU next file to search */
+ uint32_t evict_max_refs_per_file;/* LRU pages per file per pass */
/*
* Cache pool information.