-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrun_db_bench.sh
executable file
·1552 lines (1301 loc) · 40.8 KB
/
run_db_bench.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/bin/bash
#set -x
KB=$((1024))
MB=$(($KB*1024))
GB=$(($MB*1024))
# APP_PREFIX=sudo
APP_PREFIX="numactl --cpunodebind=0 --membind=0"
db_path=$(pwd)
db_bench=$db_path/build
db_include=$db_path/include
ycsb_path=$db_path/ycsbc
sata_path=/tmp/pm_test
# ssd_path=/tmp/pm_test
ssd_path=/media/nvme/pm_test
pm_path=/mnt/pmem0.1/pm_test
# leveldb_path=/tmp/leveldb
leveldb_path=$pm_path
output_path=$db_path/output-new8
output_file=$output_path/result.out
export CPLUS_INCLUDE_PATH=$db_path/include:$CPLUS_INCLUDE_PATH
export LIBRARY_PATH=$db_path/build:$LIBRARY_PATH
benchmarks="overwrite,readrandom,readseq,stats"
# benchmarks2="fillseqNofresh,readrandom,readseq,stats"
ycsb_input=1KB_ALL
num_thread=1
value_size=1024
num_kvs=$((10*$MB))
write_buffer_size=$((64*$MB))
max_file_size=$((128*$MB))
pm_size=$((180*$GB))
bucket_nums=$((4*$MB)) # bucket_nums * 4 > nums_kvs
max_open_files=$((10000))
reads=$((-1))
use_pm=1
flush_ssd=0
throughput=0
dynamic_tree=1
write_batch=1
gc_ratio=0.5
WRITE10M-8B() {
value_size=$((8))
num_kvs=$((10*$MB))
write_batch=1;
bucket_nums=$((32*$MB)) # bucket_nums * 4 > nums_kvs
}
WRITE400G-1K() {
value_size=$((1*$KB))
num_kvs=$((200*$GB / $value_size))
write_batch=5;
bucket_nums=$((64*$MB)) # bucket_nums * 4 > nums_kvs
}
WRITE400G-4K() {
value_size=$((4*$KB))
num_kvs=$((200*$GB / $value_size))
write_batch=5;
bucket_nums=$((32*$MB)) # bucket_nums * 4 > nums_kvs
}
WRITE400G-16K() {
value_size=$((16*$KB))
num_kvs=$((200*$GB / $value_size))
write_batch=5;
bucket_nums=$((32*$MB)) # bucket_nums * 4 > nums_kvs
}
WRITE100M-8B() {
value_size=$((8))
num_kvs=$((100*$MB))
write_batch=1;
bucket_nums=$((32*$MB)) # bucket_nums * 4 > nums_kvs
}
WRITE100M-64B() {
value_size=$((64))
num_kvs=$((100*$MB))
write_batch=1;
bucket_nums=$((32*$MB)) # bucket_nums * 4 > nums_kvs
}
WRITE100M-256B() {
value_size=$((256))
num_kvs=$((100*$MB))
write_batch=1;
bucket_nums=$((32*$MB)) # bucket_nums * 4 > nums_kvs
}
WRITE100M-1KB() {
value_size=$((1*$KB))
num_kvs=$((100*$MB))
write_batch=5;
bucket_nums=$((32*$MB)) # bucket_nums * 4 > nums_kvs
}
WRITE100M-4KB() {
value_size=$((4*$KB))
num_kvs=$((100*$MB))
write_batch=5;
bucket_nums=$((32*$MB)) # bucket_nums * 4 > nums_kvs
}
WRITE20G() {
value_size=$((1*$KB))
num_kvs=$((20*$GB / $value_size))
bucket_nums=$((32*$MB)) # bucket_nums * 4 > nums_kvs
}
WRITE80G_FLUSHSSD() {
leveldb_path=$ssd_path;
value_size=$((4*$KB))
num_kvs=$((80*$GB / $value_size))
pm_size=$((8*$GB))
bucket_nums=$((8*$MB)) # bucket_nums * 4 > nums_kvs
flush_ssd=1
}
WRITE80G-1KB-THROUGHPUT() {
value_size=$((1*$KB))
num_kvs=$((80*$GB / $value_size))
bucket_nums=$((32*$MB)) # bucket_nums * 4 > nums_kvs
throughput=1
}
WRITE80G-4KB-THROUGHPUT() {
value_size=$((4*$KB))
num_kvs=$((80*$GB / $value_size))
bucket_nums=$((8*$MB)) # bucket_nums * 4 > nums_kvs
throughput=1
}
WRITE80G-16KB-THROUGHPUT() {
value_size=$((16*$KB))
num_kvs=$((80*$GB / $value_size))
bucket_nums=$((8*$MB)) # bucket_nums * 4 > nums_kvs
throughput=1
}
WRITE80G-64KB-THROUGHPUT() {
value_size=$((64*$KB))
num_kvs=$((80*$GB / $value_size))
bucket_nums=$((8*$MB)) # bucket_nums * 4 > nums_kvs
throughput=1
}
WRITE80G-256B() {
value_size=$((256))
num_kvs=$((80*$GB / $value_size))
bucket_nums=$((128*$MB)) # bucket_nums * 4 > nums_kvs
}
WRITE80G() {
value_size=$((1*$KB))
num_kvs=$((80*$GB / $value_size))
bucket_nums=$((32*$MB)) # bucket_nums * 4 > nums_kvs
}
WRITE80G-4K() {
value_size=$((4*$KB))
num_kvs=$((80*$GB / $value_size))
bucket_nums=$((8*$MB)) # bucket_nums * 4 > nums_kvs
}
WRITE80G-16K() {
value_size=$((16*$KB))
num_kvs=$((80*$GB / $value_size))
bucket_nums=$((8*$MB)) # bucket_nums * 4 > nums_kvs
}
WRITE80G-64K() {
value_size=$((64*$KB))
num_kvs=$((80*$GB / $value_size))
bucket_nums=$((8*$MB)) # bucket_nums * 4 > nums_kvs
}
WRITE40G-4K() {
value_size=$((4*$KB))
num_kvs=$((40*$GB / $value_size))
bucket_nums=$((32*$MB)) # bucket_nums * 4 > nums_kvs
}
WRITE40G-1K() {
value_size=$((1*$KB))
num_kvs=$((40*$GB / $value_size))
bucket_nums=$((32*$MB)) # bucket_nums * 4 > nums_kvs
}
WRITE80G_8GNVM() {
leveldb_path=$ssd_path;
value_size=$((1*$KB))
num_kvs=$((80*$GB / $value_size))
pm_size=$((8*$GB))
bucket_nums=$((16*$MB)) # bucket_nums * 4 > nums_kvs
flush_ssd=1
}
WRITE80G_16GNVM() {
leveldb_path=$ssd_path;
value_size=$((1*$KB))
num_kvs=$((80*$GB / $value_size))
pm_size=$((16*$GB))
bucket_nums=$((8*$MB)) # bucket_nums * 4 > nums_kvs
flush_ssd=1
}
WRITE80G_32GNVM() {
leveldb_path=$ssd_path;
value_size=$((1*$KB))
num_kvs=$((80*$GB / $value_size))
pm_size=$((32*$GB))
bucket_nums=$((8*$MB)) # bucket_nums * 4 > nums_kvs
flush_ssd=1
}
WRITE80G_64GNVM() {
leveldb_path=$ssd_path;
value_size=$((1*$KB))
num_kvs=$((80*$GB / $value_size))
pm_size=$((64*$GB))
bucket_nums=$((8*$MB)) # bucket_nums * 4 > nums_kvs
flush_ssd=1
}
WRITE80G_8GNVM_4K() {
leveldb_path=$ssd_path;
value_size=$((4*$KB))
num_kvs=$((80*$GB / $value_size))
pm_size=$((8*$GB))
bucket_nums=$((16*$MB)) # bucket_nums * 4 > nums_kvs
flush_ssd=1
}
WRITE80G_16GNVM_4K() {
leveldb_path=$ssd_path;
value_size=$((4*$KB))
num_kvs=$((80*$GB / $value_size))
pm_size=$((16*$GB))
bucket_nums=$((8*$MB)) # bucket_nums * 4 > nums_kvs
flush_ssd=1
}
WRITE80G_32GNVM_4K() {
leveldb_path=$ssd_path;
value_size=$((4*$KB))
num_kvs=$((80*$GB / $value_size))
pm_size=$((32*$GB))
bucket_nums=$((8*$MB)) # bucket_nums * 4 > nums_kvs
flush_ssd=1
}
WRITE80G_64GNVM_4K() {
leveldb_path=$ssd_path;
value_size=$((4*$KB))
num_kvs=$((80*$GB / $value_size))
pm_size=$((64*$GB))
bucket_nums=$((8*$MB)) # bucket_nums * 4 > nums_kvs
flush_ssd=1
}
RUN_DB_BENCH() {
CLEAN_DB
output_file=$output_file.txt
if [ -f "$output_file" ]; then
rm "$output_file"
echo "delete output_file: $output_file"
fi
parameters="--benchmarks=$benchmarks \
--num=$num_kvs \
--value_size=$value_size \
--write_buffer_size=$write_buffer_size \
--max_file_size=$max_file_size \
--open_files=$max_open_files \
--reads=$reads \
--pm_size=$pm_size \
--pm_path=$pm_path \
--db=$leveldb_path \
--bucket_nums=$bucket_nums \
--use_pm=$use_pm \
--threads=$num_thread \
--flush_ssd=$flush_ssd \
--throughput=$throughput \
--dynamic_tree=$dynamic_tree \
--write_batch=$write_batch \
--gc_ratio=$gc_ratio \
"
cmd="$APP_PREFIX $db_bench/db_bench $parameters >> $output_file"
echo "$cmd" >> "$output_file"
echo "$cmd"
eval "$cmd"
}
RUN_YCSB(){
CLEAN_DB
if [ -f "$output_file" ]; then
rm "$output_file"
echo "delete output_file: $output_file"
fi
cmd="$APP_PREFIX $ycsb_path/ycsbc $ycsb_path/input/$ycsb_input >> $output_file"
echo "$cmd" >> "$output_file"
echo "$cmd"
eval "$cmd"
}
CLEAN_DB() {
if [ -z "$pm_path" ]
then
echo "PM path empty."
exit
fi
if [ -z "$leveldb_path" ]
then
echo "DB path empty."
exit
fi
find ${pm_path:?} -type f ! -name 'allocator.edb' -delete
find ${leveldb_path:?} -type f ! -name 'allocator.edb' -delete
# rm -rf ${leveldb_path:?}/*
# rm -rf ${pm_path:?}/*
# mkdir -p $pm_path
}
CLEAN_ALL_DB() {
if [ -z "$pm_path" ]
then
echo "PM path empty."
exit
fi
if [ -z "$leveldb_path" ]
then
echo "DB path empty."
exit
fi
find ${pm_path:?} -type f ! -name 'allocator.edb' -delete
find ${leveldb_path:?} -type f ! -name 'allocator.edb' -delete
# rm -rf ${leveldb_path:?}/*
# rm -rf ${pm_path:?}/*
# mkdir -p $pm_path
}
SET_OUTPUT_PATH() {
if [ ! -d "$output_path" ]; then
mkdir "$output_path"
echo "Created output_path: $output_path"
fi
# else
# rm -rf "${output_path:?}/"*
# echo "Cleared output_path: $output_path"
# fi
# touch $output_file
# echo "Created file: $output_file"
}
MAKE() {
if [ ! -d "$db_bench" ]; then
mkdir "$db_bench"
fi
cd $db_bench
cmake -DCMAKE_BUILD_TYPE=Release .. && cmake --build .
cd ..
cd "$ycsb_path" || exit
make clean
make
cd ..
}
DB_BENCH_TEST() {
echo "------------db_bench------------"
benchmarks="fillrandom,readrandom,readseq,stats"
# echo "------256B random write/read-----"
# output_file=$output_path/Rnd_NVM_256B
# WRITE80G-256B
# RUN_DB_BENCH
echo "------1KB random write/read-----"
output_file=$output_path/Rnd_NVM_1K
WRITE80G
RUN_DB_BENCH
echo "------4KB random write/read-----"
output_file=$output_path/Rnd_NVM_4K
WRITE80G-4K
RUN_DB_BENCH
echo "------16KB random write/read-----"
output_file=$output_path/Rnd_NVM_16K
WRITE80G-16K
RUN_DB_BENCH
echo "------64KB random write/read-----"
output_file=$output_path/Rnd_NVM_64K
WRITE80G-64K
RUN_DB_BENCH
benchmarks="fillseq,stats"
# benchmarks="fillseq,readseq,stats"
echo "------256B random write/read-----"
output_file=$output_path/Seq_NVM_256B
WRITE80G-256B
RUN_DB_BENCH
echo "------1KB sequential write/read-----"
output_file=$output_path/Seq_NVM_1K
WRITE80G
RUN_DB_BENCH
echo "------4KB sequential write/read-----"
output_file=$output_path/Seq_NVM_4K
WRITE80G-4K
RUN_DB_BENCH
echo "------16KB sequential write/read-----"
output_file=$output_path/Seq_NVM_16K
WRITE80G-16K
RUN_DB_BENCH
echo "------64KB sequential write/read-----"
output_file=$output_path/Seq_NVM_64K
WRITE80G-64K
RUN_DB_BENCH
CLEAN_DB
}
DB_BENCH_TEST2() {
echo "------------db_bench------------"
benchmarks="fillrandom,readseq,stats"
echo "------256B random write/read-----"
output_file=$output_path/Rnd_NVM_256B
WRITE80G-256B
RUN_DB_BENCH
echo "------1KB random write/read-----"
output_file=$output_path/Rnd_NVM_1K
WRITE80G
RUN_DB_BENCH
echo "------4KB random write/read-----"
output_file=$output_path/Rnd_NVM_4K
WRITE80G-4K
RUN_DB_BENCH
echo "------16KB random write/read-----"
output_file=$output_path/Rnd_NVM_16K
WRITE80G-16K
RUN_DB_BENCH
echo "------64KB random write/read-----"
output_file=$output_path/Rnd_NVM_64K
WRITE80G-64K
RUN_DB_BENCH
CLEAN_DB
}
DB_BENCH_THROUGHPUT() {
echo "--------db_bench-throughput-------"
benchmarks="fillrandom,stats"
echo "------1K random write/read-----"
output_file=$output_path/Throughput_Rnd_NVM_1KB
WRITE80G-1KB-THROUGHPUT
RUN_DB_BENCH
# echo "------4K random write/read-----"
# output_file=$output_path/Throughput_Rnd_NVM_4KB
# WRITE80G-4KB-THROUGHPUT
# RUN_DB_BENCH
# throughput=0
# echo "------16K random write/read-----"
# output_file=$output_path/Throughput_Rnd_NVM_16KB
# WRITE80G-16KB-THROUGHPUT
# RUN_DB_BENCH
# throughput=0
# echo "------64K random write/read-----"
# output_file=$output_path/Throughput_Rnd_NVM_64KB
# WRITE80G-64KB-THROUGHPUT
# RUN_DB_BENCH
# throughput=0
CLEAN_DB
}
DB_BENCH_TEST_FLUSHSSD() {
leveldb_path=$ssd_path;
echo "----------db_bench_flushssd----------"
APP_PREFIX=""
benchmarks="fillrandom,readrandom,readseq,stats"
# benchmarks="fillrandom,readrandom,stats"
echo "---8GNVM--1KB random write/read---"
output_file=$output_path/NVM8G_Rnd_1K
WRITE80G_8GNVM
RUN_DB_BENCH
echo "---16GNVM--1KB random write/read---"
output_file=$output_path/NVM16G_Rnd_1K
WRITE80G_16GNVM
RUN_DB_BENCH
echo "---32GNVM--1KB random write/read---"
output_file=$output_path/NVM32G_Rnd_1K
WRITE80G_32GNVM
RUN_DB_BENCH
echo "---64GNVM--1KB random write/read---"
output_file=$output_path/NVM64G_Rnd_1K
WRITE80G_64GNVM
RUN_DB_BENCH
benchmarks="fillseq,stats"
# benchmarks="fillseq,readseq,stats"
echo "---8GNVM--1KB seq write/read---"
output_file=$output_path/NVM8G_Seq_1K
WRITE80G_8GNVM
RUN_DB_BENCH
echo "---16GNVM--1KB seq write/read---"
output_file=$output_path/NVM16G_Seq_1K
WRITE80G_16GNVM
RUN_DB_BENCH
echo "---32GNVM--1KB seq write/read---"
output_file=$output_path/NVM32G_Seq_1K
WRITE80G_32GNVM
RUN_DB_BENCH
echo "---64GNVM--1KB seq write/read---"
output_file=$output_path/NVM64G_Seq_1K
WRITE80G_64GNVM
RUN_DB_BENCH
CLEAN_DB
APP_PREFIX="numactl --cpunodebind=0 --membind=0"
pm_size=$((180*$GB))
flush_ssd=0
leveldb_path=$pm_path;
}
DB_BENCH_TEST_FLUSHSSD2() {
leveldb_path=$ssd_path;
echo "----------db_bench_flushssd----------"
APP_PREFIX=""
benchmarks="fillrandom,readseq,stats"
echo "---8GNVM--1KB random write/read---"
output_file=$output_path/NVM8G_Rnd_1K
WRITE80G_8GNVM
RUN_DB_BENCH
echo "---16GNVM--1KB random write/read---"
output_file=$output_path/NVM16G_Rnd_1K
WRITE80G_16GNVM
RUN_DB_BENCH
echo "---32GNVM--1KB random write/read---"
output_file=$output_path/NVM32G_Rnd_1K
WRITE80G_32GNVM
RUN_DB_BENCH
echo "---64GNVM--1KB random write/read---"
output_file=$output_path/NVM64G_Rnd_1K
WRITE80G_64GNVM
RUN_DB_BENCH
CLEAN_DB
APP_PREFIX="numactl --cpunodebind=0 --membind=0"
pm_size=$((180*$GB))
flush_ssd=0
leveldb_path=$pm_path;
}
DB_BENCH_TEST_FLUSHSSD_4K() {
leveldb_path=$ssd_path;
echo "----------db_bench_flushssd----------"
APP_PREFIX=""
benchmarks="fillrandom,readrandom,stats"
echo "---8GNVM--4KB random write/read---"
output_file=$output_path/NVM8G_Rnd_4K
WRITE80G_8GNVM_4K
RUN_DB_BENCH
echo "---16GNVM--4KB random write/read---"
output_file=$output_path/NVM16G_Rnd_4K
WRITE80G_16GNVM_4K
RUN_DB_BENCH
echo "---32GNVM--4KB random write/read---"
output_file=$output_path/NVM32G_Rnd_4K
WRITE80G_32GNVM_4K
RUN_DB_BENCH
echo "---64GNVM--4KB random write/read---"
output_file=$output_path/NVM64G_Rnd_4K
WRITE80G_64GNVM_4K
RUN_DB_BENCH
benchmarks="fillseq,readseq,stats"
echo "---8GNVM--4KB seq write/read---"
output_file=$output_path/NVM8G_Seq_4K
WRITE80G_8GNVM_4K
RUN_DB_BENCH
echo "---16GNVM--4KB seq write/read---"
output_file=$output_path/NVM16G_Seq_4K
WRITE80G_16GNVM_4K
RUN_DB_BENCH
echo "---32GNVM--4KB seq write/read---"
output_file=$output_path/NVM32G_Seq_4K
WRITE80G_32GNVM_4K
RUN_DB_BENCH
echo "---64GNVM--4KB seq write/read---"
output_file=$output_path/NVM64G_Seq_4K
WRITE80G_64GNVM_4K
RUN_DB_BENCH
CLEAN_DB
APP_PREFIX="numactl --cpunodebind=0 --membind=0"
pm_size=$((180*$GB))
flush_ssd=0
leveldb_path=$pm_path;
}
YCSB_TEST(){
cd "$ycsb_path" || exit
echo "------------YCSB------------"
echo "-----1KB YCSB performance-----"
output_file=$output_path/YCSB_1KB
ycsb_input=1KB_ALL
RUN_YCSB
echo "------------YCSB------------"
echo "-----1KB YCSB performance-----"
output_file=$output_path/YCSB_1KB
ycsb_input=1KB_ALL
RUN_YCSB
echo "-----4KB YCSB performance-----"
output_file=$output_path/YCSB_4KB
ycsb_input=4KB_ALL
RUN_YCSB
cd ..
}
YCSB_TEST_LATENCY(){
cd "$ycsb_path" || exit
echo "------------YCSB------------"
echo "-----1KB YCSB latency-----"
output_file=$output_path/YCSB_1KB_Latency
ycsb_input=1KB_ALL_Latency
RUN_YCSB
echo "-----4KB YCSB latency-----"
output_file=$output_path/YCSB_4KB_Latency
ycsb_input=4KB_ALL_Latency
RUN_YCSB
cd ..
}
YCSB_TEST_SSD(){
APP_PREFIX=""
cd "$ycsb_path" || exit
echo "------------YCSB------------"
echo "-----1KB YCSB SSD-----"
output_file=$output_path/YCSB_1KB_SSD
ycsb_input=1KB_ALL_SSD
RUN_YCSB
echo "-----4KB YCSB SSD-----"
output_file=$output_path/YCSB_4KB_SSD
ycsb_input=4KB_ALL_SSD
RUN_YCSB
cd ..
APP_PREFIX="numactl --cpunodebind=0 --membind=0"
}
CUCKOO_FILTER_ANALYSIS(){
echo "------cuckoo filter analysis-------"
sed -i 's/READ_TIME_ANALYSIS = false/READ_TIME_ANALYSIS = true/g' "$db_path"/util/global.h
benchmarks="fillseq,fillrandom,readwhilewriting,stats"
echo "---- with cuckoo filter ----"
sed -i 's/CUCKOO_FILTER = false/CUCKOO_FILTER = true/g' "$db_path"/util/global.h
MAKE
output_file=$output_path/Cuckoo_Filter_YES_RW_NVM_4K
WRITE40G-4K
RUN_DB_BENCH
echo "---- without cuckoo filter ----"
sed -i 's/CUCKOO_FILTER = true/CUCKOO_FILTER = false/g' "$db_path"/util/global.h
MAKE
output_file=$output_path/Cuckoo_Filter_NO_RW_NVM_4K
WRITE40G-4K
RUN_DB_BENCH
sed -i 's/READ_TIME_ANALYSIS = true/READ_TIME_ANALYSIS = false/g' "$db_path"/util/global.h
sed -i 's/CUCKOO_FILTER = false/CUCKOO_FILTER = true/g' "$db_path"/util/global.h
MAKE
}
CUCKOO_FILTER_ANALYSIS2(){
echo "------cuckoo filter analysis-------"
sed -i 's/READ_TIME_ANALYSIS = false/READ_TIME_ANALYSIS = true/g' "$db_path"/util/global.h
sed -i 's/TEST_CUCKOOFILTER = false/TEST_CUCKOOFILTER = true/g' "$db_path"/util/global.h
# benchmarks="fillrandom,stats"
# echo "---- with delete cuckoo filter without bloom filter----"
# sed -i 's/TEST_CUCKOO_DELETE = false/TEST_CUCKOO_DELETE = true/g' "$db_path"/util/global.h
# sed -i 's/TEST_CUCKOOFILTER = true/TEST_CUCKOOFILTER = false/g' "$db_path"/util/global.h
# MAKE
# output_file=$output_path/Cuckoo_Filter_Delete_R_NVM_1K
# WRITE80G
# RUN_DB_BENCH
# sed -i 's/TEST_CUCKOO_DELETE = true/TEST_CUCKOO_DELETE = false/g' "$db_path"/util/global.h
# sed -i 's/TEST_CUCKOOFILTER = false/TEST_CUCKOOFILTER = true/g' "$db_path"/util/global.h
# MAKE
benchmarks="fillrandom,stats,readrandom,stats"
echo "---- without cuckoo filter without bloom filter----"
sed -i 's/CUCKOO_FILTER = true/CUCKOO_FILTER = false/g' "$db_path"/util/global.h
MAKE
output_file=$output_path/Cuckoo_Filter_NO_BL_NO_RW_NVM_1K
WRITE80G
RUN_DB_BENCH
echo "---- without cuckoo filter with bloom filter----"
sed -i 's/CUCKOO_FILTER = true/CUCKOO_FILTER = false/g' "$db_path"/util/global.h
sed -i 's/BLOOM_FILTER = false/BLOOM_FILTER = true/g' "$db_path"/util/global.h
MAKE
output_file=$output_path/Cuckoo_Filter_NO_BL_YES_RW_NVM_1K
WRITE80G
RUN_DB_BENCH
echo "---- with cuckoo filter 32M ----"
sed -i 's/CUCKOO_FILTER = false/CUCKOO_FILTER = true/g' "$db_path"/util/global.h
sed -i 's/BLOOM_FILTER = true/BLOOM_FILTER = false/g' "$db_path"/util/global.h
MAKE
output_file=$output_path/Cuckoo_Filter_YES_RW_NVM_1K
WRITE80G
RUN_DB_BENCH
# echo "---- with cuckoo filter 16M ----"
# output_file=$output_path/Cuckoo_Filter_YES_16M_RW_NVM_1K
# WRITE80G
# bucket_nums=$((16*$MB))
# RUN_DB_BENCH
# echo "---- with cuckoo filter 8MB ----"
# output_file=$output_path/Cuckoo_Filter_YES_8M_RW_NVM_1K
# WRITE80G
# bucket_nums=$((8*$MB))
# RUN_DB_BENCH
# echo "---- with cuckoo filter 4MB----"
# output_file=$output_path/Cuckoo_Filter_YES_4M_RW_NVM_1K
# WRITE80G
# bucket_nums=$((4*$MB))
# RUN_DB_BENCH
# echo "---- with cuckoo filter with bloom filter 16M ----"
# sed -i 's/CUCKOO_FILTER = false/CUCKOO_FILTER = true/g' "$db_path"/util/global.h
# sed -i 's/BLOOM_FILTER = false/BLOOM_FILTER = true/g' "$db_path"/util/global.h
# MAKE
# output_file=$output_path/Cuckoo_Filter_YES_BL_YES_16M_RW_NVM_1K
# WRITE80G
# RUN_DB_BENCH
# echo "---- with cuckoo filter with bloom filter 8M ----"
# sed -i 's/CUCKOO_FILTER = false/CUCKOO_FILTER = true/g' "$db_path"/util/global.h
# sed -i 's/BLOOM_FILTER = false/BLOOM_FILTER = true/g' "$db_path"/util/global.h
# MAKE
# output_file=$output_path/Cuckoo_Filter_YES_BL_YES_8M_RW_NVM_1K
# WRITE80G
# RUN_DB_BENCH
sed -i 's/READ_TIME_ANALYSIS = true/READ_TIME_ANALYSIS = false/g' "$db_path"/util/global.h
sed -i 's/TEST_CUCKOOFILTER = true/TEST_CUCKOOFILTER = false/g' "$db_path"/util/global.h
sed -i 's/CUCKOO_FILTER = false/CUCKOO_FILTER = true/g' "$db_path"/util/global.h
sed -i 's/BLOOM_FILTER = true/BLOOM_FILTER = false/g' "$db_path"/util/global.h
MAKE
}
WRITE_TIME_ANALYSIS(){
echo "------write time analysis-------"
sed -i 's/WRITE_TIME_ANALYSIS = false/WRITE_TIME_ANALYSIS = true/g' "$db_path"/util/global.h
benchmarks="fillrandom,stats"
MAKE
# output_file=$output_path/WRITE_TIME_ANALYSIS_80G_4K_RND
# WRITE80G-4K
# RUN_DB_BENCH
output_file=$output_path/WRITE_TIME_ANALYSIS_80G_1K_RND
WRITE80G
RUN_DB_BENCH
sed -i 's/WRITE_TIME_ANALYSIS = true/WRITE_TIME_ANALYSIS = false/g' "$db_path"/util/global.h
MAKE
}
THREAD_COUNT_ANALYSIS(){
leveldb_path=$ssd_path;
echo "------thread count analysis-------"
benchmarks="fillrandom,stats"
echo "---- 1 thread ----"
sed -i 's/TASK_COUNT = [0-9]*/TASK_COUNT = 1/g' "$db_path"/util/global.h
MAKE
output_file=$output_path/Thead_1_Rnd_W_8GNVM_1K
WRITE80G_16GNVM
RUN_DB_BENCH
echo "---- 4 thread ----"
sed -i 's/TASK_COUNT = [0-9]*/TASK_COUNT = 4/g' "$db_path"/util/global.h
MAKE
output_file=$output_path/Thead_4_Rnd_W_8GNVM_1K
WRITE80G_16GNVM
RUN_DB_BENCH
echo "---- 8 thread ----"
sed -i 's/TASK_COUNT = [0-9]*/TASK_COUNT = 8/g' "$db_path"/util/global.h
MAKE
output_file=$output_path/Thead_8_Rnd_W_8GNVM_1K
WRITE80G_16GNVM
RUN_DB_BENCH
echo "---- 16 thread ----"
sed -i 's/TASK_COUNT = [0-9]*/TASK_COUNT = 16/g' "$db_path"/util/global.h
MAKE
output_file=$output_path/Thead_16_Rnd_W_8GNVM_1K
WRITE80G_16GNVM
RUN_DB_BENCH
echo "---- 32 thread ----"
sed -i 's/TASK_COUNT = [0-9]*/TASK_COUNT = 32/g' "$db_path"/util/global.h
MAKE
output_file=$output_path/Thead_32_Rnd_W_8GNVM_1K
WRITE80G_16GNVM
RUN_DB_BENCH
echo "---- 64 thread ----"
sed -i 's/TASK_COUNT = [0-9]*/TASK_COUNT = 64/g' "$db_path"/util/global.h
MAKE
output_file=$output_path/Thead_64_Rnd_W_8GNVM_1K
WRITE80G_16GNVM
RUN_DB_BENCH
pm_size=$((180*$GB))
flush_ssd=0
leveldb_path=$pm_path;
}
DYNAMIC_TREE_ANALYSIS(){
echo "------dynamic tree analysis-------"
benchmarks="fillrandom,stats"
throughput=1
echo "---- dynamic ----"
output_file=$output_path/tree_dynamic
dynamic_tree=1
write_buffer_size=$((64*$MB))
WRITE80G
RUN_DB_BENCH
echo "---- static 16MB memtable----"
output_file=$output_path/tree_static_16MB
dynamic_tree=0
write_buffer_size=$((16*$MB))
WRITE80G
RUN_DB_BENCH
echo "---- static 32MB memtable----"
output_file=$output_path/tree_static_32MB
dynamic_tree=0
write_buffer_size=$((32*$MB))
WRITE80G
RUN_DB_BENCH
echo "---- static 64MB memtable----"
output_file=$output_path/tree_static_64MB
dynamic_tree=0
write_buffer_size=$((64*$MB))
WRITE80G
RUN_DB_BENCH
echo "---- static 128MB memtable----"
output_file=$output_path/tree_static_128MB
dynamic_tree=0
write_buffer_size=$((128*$MB))
WRITE80G
RUN_DB_BENCH
echo "---- static 256MB memtable----"
output_file=$output_path/tree_static_256MB
dynamic_tree=0
write_buffer_size=$((256*$MB))
WRITE80G
RUN_DB_BENCH
throughput=0
dynamic_tree=1
write_buffer_size=$((64*$MB))
}
DATA_SIZE_ANALYSIS(){
flush_ssd=1
leveldb_path=$ssd_path
bucket_nums=$((64*$MB)) # bucket_nums * 4 > nums_kvs
value_size=$((1*$KB))
echo "------data size analysis-------"
benchmarks="fillrandom,readrandom,stats"
CLEAN_ALL_DB
echo "---- 40GB 8GNVM----"
output_file=$output_path/data_40G
pm_size=$((8*$GB))
write_buffer_size=$((64*$MB))
num_kvs=$((40*$GB / $value_size))
RUN_DB_BENCH
echo "---- 80GB 16GNVM----"
output_file=$output_path/data_80G
pm_size=$((16*$GB))
write_buffer_size=$((64*$MB))
num_kvs=$((80*$GB / $value_size))
RUN_DB_BENCH
echo "---- 120GB 24GNVM----"
output_file=$output_path/data_120G
pm_size=$((24*$GB))
write_buffer_size=$((64*$MB))
num_kvs=$((120*$GB / $value_size))
RUN_DB_BENCH
echo "---- 160GB 32GNVM----"
output_file=$output_path/data_160G
pm_size=$((32*$GB))
write_buffer_size=$((64*$MB))
num_kvs=$((160*$GB / $value_size))
RUN_DB_BENCH
echo "---- 200GB 40GNVM----"
output_file=$output_path/data_200G
pm_size=$((40*$GB))
write_buffer_size=$((64*$MB))
num_kvs=$((200*$GB / $value_size))
RUN_DB_BENCH
bucket_nums=$((64*$MB)) # bucket_nums * 4 > nums_kvs
pm_size=$((180*$GB))
flush_ssd=0
leveldb_path=$pm_path
}
NVM_DATA_SIZE_ANALYSIS(){
# flush_ssd=1
# leveldb_path=$ssd_path
pm_size=$((400*$GB))
bucket_nums=$((64*$MB)) # bucket_nums * 4 > nums_kvs
value_size=$((1*$KB))
echo "------data size analysis-------"
benchmarks="fillrandom,readrandom,stats"
CLEAN_ALL_DB
echo "---- 40GB 8GNVM----"
output_file=$output_path/data_NVM_40G
write_buffer_size=$((256*$MB))
num_kvs=$((40*$GB / $value_size))
RUN_DB_BENCH
echo "---- 80GB 16GNVM----"
output_file=$output_path/data_NVM_80G
write_buffer_size=$((256*$MB))
num_kvs=$((80*$GB / $value_size))
RUN_DB_BENCH
echo "---- 120GB 24GNVM----"
output_file=$output_path/data_NVM_120G
write_buffer_size=$((256*$MB))
num_kvs=$((120*$GB / $value_size))
RUN_DB_BENCH
echo "---- 160GB 32GNVM----"
output_file=$output_path/data_NVM_160G
write_buffer_size=$((256*$MB))
num_kvs=$((160*$GB / $value_size))
RUN_DB_BENCH
echo "---- 200GB 40GNVM----"
output_file=$output_path/data_NVM_200G
write_buffer_size=$((256*$MB))
num_kvs=$((200*$GB / $value_size))
RUN_DB_BENCH
bucket_nums=$((64*$MB)) # bucket_nums * 4 > nums_kvs
pm_size=$((180*$GB))
# flush_ssd=0
# leveldb_path=$pm_path
}