summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Cahill <michael.cahill@wiredtiger.com>2013-04-29 10:57:25 +1000
committerMichael Cahill <michael.cahill@wiredtiger.com>2013-04-29 10:57:25 +1000
commit3ed719dd05111d2a64bc9102c627c941c4f8d7e0 (patch)
tree97d5f96e013a2a0386ff8275ae45659cc2a1891d /src
parentaed18aaae5655665af93be6db4bd2b6bab99997f (diff)
downloadmongo-3ed719dd05111d2a64bc9102c627c941c4f8d7e0.tar.gz
LSM worker threads don't need to check the state so often: increase sleep times.
Diffstat (limited to 'src')
-rw-r--r--src/lsm/lsm_worker.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/lsm/lsm_worker.c b/src/lsm/lsm_worker.c
index 7d756eeda85..d96820c6ad0 100644
--- a/src/lsm/lsm_worker.c
+++ b/src/lsm/lsm_worker.c
@@ -67,14 +67,14 @@ __wt_lsm_merge_worker(void *vargs)
WT_LSM_TREE *lsm_tree;
WT_SESSION_IMPL *session;
u_int id;
- int progress, stalls;
+ int progress, stallms;
args = vargs;
lsm_tree = args->lsm_tree;
id = args->id;
session = lsm_tree->worker_sessions[id];
__wt_free(session, args);
- stalls = 0;
+ stallms = 0;
while (F_ISSET(lsm_tree, WT_LSM_TREE_WORKING)) {
progress = 0;
@@ -83,7 +83,7 @@ __wt_lsm_merge_worker(void *vargs)
session->dhandle = NULL;
/* Report stalls to merge in seconds. */
- if (__wt_lsm_merge(session, lsm_tree, id, stalls / 100) == 0)
+ if (__wt_lsm_merge(session, lsm_tree, id, stallms / 1000) == 0)
progress = 1;
/* Clear any state from previous worker thread iterations. */
@@ -99,10 +99,14 @@ __wt_lsm_merge_worker(void *vargs)
progress = 1;
if (progress)
- stalls = 0;
+ stallms = 0;
else {
- __wt_sleep(0, 10000);
- ++stalls;
+ /*
+ * The "main" thread polls 10 times per second,
+ * secondary threads once per second.
+ */
+ __wt_sleep(0, id == 0 ? 100000 : 1000000);
+ stallms += (id == 0) ? 100 : 1000;
}
}
@@ -162,7 +166,7 @@ __wt_lsm_bloom_worker(void *arg)
++j;
}
if (j == 0)
- __wt_sleep(0, 10000);
+ __wt_sleep(0, 100000);
}
err: __wt_free(session, cookie.chunk_array);