Skip to content

Commit 394e562

Browse files
Added seek and scan counts, parallel reads divide count over concurrent readers.
1 parent aacee06 commit 394e562

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

fdbserver/VersionedBTree.actor.cpp

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8154,6 +8154,8 @@ TEST_CASE(":/redwood/performance/set") {
81548154
state bool insertRecords = !openExisting || params.getIntParam("insertRecords").orDefault(0);
81558155
state int concurrentSeeks = params.getIntParam("concurrentSeeks").orDefault(64);
81568156
state int concurrentScans = params.getIntParam("concurrentScans").orDefault(64);
8157+
state int seeks = params.getIntParam("seeks").orDefault(1000000);
8158+
state int scans = params.getIntParam("scans").orDefault(20000);
81578159

81588160
printf("pageSize: %d\n", pageSize);
81598161
printf("pageCacheBytes: %" PRId64 "\n", pageCacheBytes);
@@ -8169,9 +8171,11 @@ TEST_CASE(":/redwood/performance/set") {
81698171
printf("kvBytesTarget: %" PRId64 "\n", kvBytesTarget);
81708172
printf("KeyLexicon '%c' to '%c'\n", firstKeyChar, lastKeyChar);
81718173
printf("remapCleanupWindow: %" PRId64 "\n", remapCleanupWindow);
8172-
printf("fileName: %s\n", fileName.c_str());
81738174
printf("concurrentScans: %d\n", concurrentScans);
81748175
printf("concurrentSeeks: %d\n", concurrentSeeks);
8176+
printf("seeks: %d\n", seeks);
8177+
printf("scans: %d\n", scans);
8178+
printf("fileName: %s\n", fileName.c_str());
81758179
printf("openExisting: %d\n", openExisting);
81768180
printf("insertRecords: %d\n", insertRecords);
81778181

@@ -8269,56 +8273,53 @@ TEST_CASE(":/redwood/performance/set") {
82698273
kvBytesTotal / (timer() - start) / 1e6);
82708274
}
82718275

8272-
int seeks = 1e6;
82738276
printf("Warming cache with seeks\n");
8274-
actors.add(randomSeeks(btree, seeks / 3, firstKeyChar, lastKeyChar));
8275-
actors.add(randomSeeks(btree, seeks / 3, firstKeyChar, lastKeyChar));
8276-
actors.add(randomSeeks(btree, seeks / 3, firstKeyChar, lastKeyChar));
8277+
for (int x = 0; x < concurrentSeeks; ++x) {
8278+
actors.add(randomSeeks(btree, seeks / concurrentSeeks, firstKeyChar, lastKeyChar));
8279+
}
82778280
wait(actors.signalAndReset());
82788281
printf("Stats:\n%s\n", g_redwoodMetrics.toString(true).c_str());
82798282

8280-
state int ops = 10000;
8281-
82828283
printf("Serial scans with adaptive readAhead...\n");
8283-
actors.add(randomScans(btree, ops, 50, -1, firstKeyChar, lastKeyChar));
8284+
actors.add(randomScans(btree, scans, 50, -1, firstKeyChar, lastKeyChar));
82848285
wait(actors.signalAndReset());
82858286
printf("Stats:\n%s\n", g_redwoodMetrics.toString(true).c_str());
82868287

82878288
printf("Serial scans with readAhead 3 pages...\n");
8288-
actors.add(randomScans(btree, ops, 50, 12000, firstKeyChar, lastKeyChar));
8289+
actors.add(randomScans(btree, scans, 50, 12000, firstKeyChar, lastKeyChar));
82898290
wait(actors.signalAndReset());
82908291
printf("Stats:\n%s\n", g_redwoodMetrics.toString(true).c_str());
82918292

82928293
printf("Serial scans with readAhead 2 pages...\n");
8293-
actors.add(randomScans(btree, ops, 50, 8000, firstKeyChar, lastKeyChar));
8294+
actors.add(randomScans(btree, scans, 50, 8000, firstKeyChar, lastKeyChar));
82948295
wait(actors.signalAndReset());
82958296
printf("Stats:\n%s\n", g_redwoodMetrics.toString(true).c_str());
82968297

82978298
printf("Serial scans with readAhead 1 page...\n");
8298-
actors.add(randomScans(btree, ops, 50, 4000, firstKeyChar, lastKeyChar));
8299+
actors.add(randomScans(btree, scans, 50, 4000, firstKeyChar, lastKeyChar));
82998300
wait(actors.signalAndReset());
83008301
printf("Stats:\n%s\n", g_redwoodMetrics.toString(true).c_str());
83018302

83028303
printf("Serial scans...\n");
8303-
actors.add(randomScans(btree, ops, 50, 0, firstKeyChar, lastKeyChar));
8304+
actors.add(randomScans(btree, scans, 50, 0, firstKeyChar, lastKeyChar));
83048305
wait(actors.signalAndReset());
83058306
printf("Stats:\n%s\n", g_redwoodMetrics.toString(true).c_str());
83068307

83078308
printf("Parallel scans, concurrency=%d, no readAhead ...\n", concurrentScans);
83088309
for (int x = 0; x < concurrentScans; ++x) {
8309-
actors.add(randomScans(btree, ops, 50, 0, firstKeyChar, lastKeyChar));
8310+
actors.add(randomScans(btree, scans / concurrentScans, 50, 0, firstKeyChar, lastKeyChar));
83108311
}
83118312
wait(actors.signalAndReset());
83128313
printf("Stats:\n%s\n", g_redwoodMetrics.toString(true).c_str());
83138314

83148315
printf("Serial seeks...\n");
8315-
actors.add(randomSeeks(btree, ops, firstKeyChar, lastKeyChar));
8316+
actors.add(randomSeeks(btree, seeks, firstKeyChar, lastKeyChar));
83168317
wait(actors.signalAndReset());
83178318
printf("Stats:\n%s\n", g_redwoodMetrics.toString(true).c_str());
83188319

83198320
printf("Parallel seeks, concurrency=%d ...\n", concurrentSeeks);
83208321
for (int x = 0; x < concurrentSeeks; ++x) {
8321-
actors.add(randomSeeks(btree, ops, firstKeyChar, lastKeyChar));
8322+
actors.add(randomSeeks(btree, seeks / concurrentSeeks, firstKeyChar, lastKeyChar));
83228323
}
83238324
wait(actors.signalAndReset());
83248325
printf("Stats:\n%s\n", g_redwoodMetrics.toString(true).c_str());

0 commit comments

Comments
 (0)