summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSusan LoVerso <sue@wiredtiger.com>2013-12-09 12:44:57 -0500
committerSusan LoVerso <sue@wiredtiger.com>2013-12-09 12:44:57 -0500
commit018c00e2165fea5bf3e6f0b962de7c5526f834c8 (patch)
tree74db9d5579be4abea069802d22f1156ed0785d89
parent171ca2ab9df93b5a44785e2010006b67eee0ee38 (diff)
downloadmongo-018c00e2165fea5bf3e6f0b962de7c5526f834c8.tar.gz
Change wtperf to remove merge_sleep and add compact. #792
-rw-r--r--bench/wtperf/runners/medium-lsm-sleep.wtperf2
-rw-r--r--bench/wtperf/wtperf.c26
-rw-r--r--bench/wtperf/wtperf_opt.i3
3 files changed, 17 insertions, 14 deletions
diff --git a/bench/wtperf/runners/medium-lsm-sleep.wtperf b/bench/wtperf/runners/medium-lsm-sleep.wtperf
index bd734e06e55..8b6e5a1f683 100644
--- a/bench/wtperf/runners/medium-lsm-sleep.wtperf
+++ b/bench/wtperf/runners/medium-lsm-sleep.wtperf
@@ -1,9 +1,9 @@
# wtperf options file: medium lsm configuration
conn_config="cache_size=1G"
table_config="lsm=(chunk_size=100MB,merge_threads=2),type=lsm"
-merge_sleep=-1
icount=50000000
report_interval=5
run_time=120
populate_threads=1
threads=((count=16,read=1))
+compact=true
diff --git a/bench/wtperf/wtperf.c b/bench/wtperf/wtperf.c
index ffb5d7698e9..467df9627cc 100644
--- a/bench/wtperf/wtperf.c
+++ b/bench/wtperf/wtperf.c
@@ -735,13 +735,14 @@ err: g_error = g_stop = 1;
static int
execute_populate(CONFIG *cfg)
{
+ WT_SESSION *session;
struct timespec start, stop;
double secs;
uint64_t last_ops;
uint32_t interval;
- u_int sleepsec;
int elapsed, ret;
+ session = NULL;
lprintf(cfg, 0, 1,
"Starting %" PRIu32 " populate thread(s)", cfg->populate_threads);
@@ -803,17 +804,20 @@ execute_populate(CONFIG *cfg)
"Load time: %.2f\n" "load ops/sec: %.2f", secs, cfg->icount / secs);
/*
- * If configured, sleep for awhile to allow LSM merging to complete in
- * the background. If user specifies -1, then sleep for as long as it
- * took to load.
+ * If configured, compact to allow LSM merging to complete.
*/
- if (cfg->merge_sleep) {
- if (cfg->merge_sleep < 0)
- sleepsec = (u_int)(stop.tv_sec - start.tv_sec);
- else
- sleepsec = (u_int)cfg->merge_sleep;
- lprintf(cfg, 0, 1, "Sleep %u seconds for merging", sleepsec);
- (void)sleep(sleepsec);
+ if (cfg->compact) {
+ if ((ret = cfg->conn->open_session(
+ cfg->conn, NULL, NULL, &session)) != 0) {
+ lprintf(cfg, ret, 0,
+ "execute_populate: WT_CONNECTION.open_session");
+ return (ret);
+ }
+ lprintf(cfg, 0, 1, "Compact after populate");
+ ret = session->compact(session, cfg->uri, NULL);
+ session->close(session, NULL);
+ if (ret != 0)
+ return (ret);
}
/*
diff --git a/bench/wtperf/wtperf_opt.i b/bench/wtperf/wtperf_opt.i
index da5a63400ef..f2c8eb6a02f 100644
--- a/bench/wtperf/wtperf_opt.i
+++ b/bench/wtperf/wtperf_opt.i
@@ -81,6 +81,7 @@ DEF_OPT_AS_UINT32(checkpoint_interval, 120, "checkpoint every interval seconds")
DEF_OPT_AS_UINT32(checkpoint_threads, 0, "number of checkpoint threads")
DEF_OPT_AS_CONFIG_STRING(conn_config, "create",
"connection configuration string")
+DEF_OPT_AS_BOOL(compact, 0, "post-populate compact for LSM merging activity")
DEF_OPT_AS_BOOL(create, 1,
"do population phase; false to use existing database")
DEF_OPT_AS_UINT32(value_sz, 100, "value size")
@@ -88,8 +89,6 @@ DEF_OPT_AS_UINT32(icount, 5000, "number of records to initially populate")
DEF_OPT_AS_BOOL(insert_rmw, 0,
"execute a read prior to each insert in workload phase")
DEF_OPT_AS_UINT32(key_sz, 20, "key size")
-DEF_OPT_AS_INT(merge_sleep, 0,
- "post-populate sleep seconds for LSM merging activity (-1 for load time)")
DEF_OPT_AS_BOOL(pareto, 0, "use pareto 80/20 distribution for random numbers")
DEF_OPT_AS_UINT32(populate_ops_per_txn, 0,
"number of operations to group into each transaction in the populate "