@@ -22,25 +22,15 @@ function cleanup {
22
22
rm -f $STAT_FILE .fillseq
23
23
rm -f $STAT_FILE .readrandom
24
24
rm -f $STAT_FILE .overwrite
25
+ rm -f $STAT_FILE .memtablefillreadrandom
25
26
}
26
27
27
28
trap cleanup EXIT
28
29
29
- function send_to_ods {
30
- key=" $1 "
31
- value=" $2 "
32
-
33
- if [ -z " $value " ]; then
34
- echo >&2 " ERROR: Key $key doesn't have a value."
35
- return
36
- fi
37
- curl -s " https://www.intern.facebook.com/intern/agent/ods_set.php?entity=rocksdb_build&key=$key &value=$value " \
38
- --connect-timeout 60
39
- }
40
-
41
30
make clean
42
- make db_bench -j$( nproc)
31
+ OPT=-DNDEBUG make db_bench -j$( nproc)
43
32
33
+ # measure fillseq + fill up the DB for overwrite benchmark
44
34
./db_bench \
45
35
--benchmarks=fillseq \
46
36
--db=$DATA_DIR \
@@ -57,6 +47,7 @@ make db_bench -j$(nproc)
57
47
--disable_wal=1 \
58
48
--sync=0 > ${STAT_FILE} .fillseq
59
49
50
+ # measure overwrite performance
60
51
./db_bench \
61
52
--benchmarks=overwrite \
62
53
--db=$DATA_DIR \
@@ -74,27 +65,94 @@ make db_bench -j$(nproc)
74
65
--sync=0 \
75
66
--threads=8 > ${STAT_FILE} .overwrite
76
67
68
+ # fill up the db for readrandom benchmark
69
+ ./db_bench \
70
+ --benchmarks=fillseq \
71
+ --db=$DATA_DIR \
72
+ --use_existing_db=0 \
73
+ --bloom_bits=10 \
74
+ --num=$NUM \
75
+ --writes=$NUM \
76
+ --cache_size=6442450944 \
77
+ --cache_numshardbits=6 \
78
+ --open_files=55000 \
79
+ --statistics=1 \
80
+ --histogram=1 \
81
+ --disable_data_sync=1 \
82
+ --disable_wal=1 \
83
+ --sync=0 \
84
+ --threads=1 > /dev/null
85
+
86
+ # measure readrandom
77
87
./db_bench \
78
88
--benchmarks=readrandom \
79
89
--db=$DATA_DIR \
80
90
--use_existing_db=1 \
81
91
--bloom_bits=10 \
82
92
--num=$NUM \
83
- --reads=$(( NUM / 100 )) \
93
+ --reads=$NUM \
84
94
--cache_size=6442450944 \
85
- --cache_numshardbits=6 \
95
+ --cache_numshardbits=8 \
96
+ --open_files=55000 \
97
+ --disable_seek_compaction=1 \
98
+ --statistics=1 \
99
+ --histogram=1 \
100
+ --disable_data_sync=1 \
101
+ --disable_wal=1 \
102
+ --sync=0 \
103
+ --threads=32 > ${STAT_FILE} .readrandom
104
+
105
+ # measure memtable performance -- none of the data gets flushed to disk
106
+ ./db_bench \
107
+ --benchmarks=fillrandom,readrandom, \
108
+ --db=$DATA_DIR \
109
+ --use_existing_db=0 \
110
+ --num=$(( NUM / 10 )) \
111
+ --reads=$NUM \
112
+ --cache_size=6442450944 \
113
+ --cache_numshardbits=8 \
114
+ --write_buffer_size=1000000000 \
86
115
--open_files=55000 \
116
+ --disable_seek_compaction=1 \
87
117
--statistics=1 \
88
118
--histogram=1 \
89
119
--disable_data_sync=1 \
90
120
--disable_wal=1 \
91
121
--sync=0 \
92
- --threads=128 > ${STAT_FILE} .readrandom
122
+ --value_size=10 \
123
+ --threads=32 > ${STAT_FILE} .memtablefillreadrandom
93
124
94
- OVERWRITE_OPS=$( awk ' /overwrite/ {print $5}' $STAT_FILE .overwrite)
95
- FILLSEQ_OPS=$( awk ' /fillseq/ {print $5}' $STAT_FILE .fillseq)
96
- READRANDOM_OPS=$( awk ' /readrandom/ {print $5}' $STAT_FILE .readrandom)
125
+ # send data to ods
126
+ function send_to_ods {
127
+ key=" $1 "
128
+ value=" $2 "
129
+
130
+ if [ -z " $value " ]; then
131
+ echo >&2 " ERROR: Key $key doesn't have a value."
132
+ return
133
+ fi
134
+ curl -s " https://www.intern.facebook.com/intern/agent/ods_set.php?entity=rocksdb_build&key=$key &value=$value " \
135
+ --connect-timeout 60
136
+ }
137
+
138
+ function send_benchmark_to_ods {
139
+ bench=" $1 "
140
+ bench_key=" $2 "
141
+ file=" $3 "
142
+
143
+ QPS=$( grep $bench $file | awk ' {print $5}' )
144
+ P50_MICROS=$( grep $bench $file -A 4 | tail -n1 | awk ' {print $3}' )
145
+ P75_MICROS=$( grep $bench $file -A 4 | tail -n1 | awk ' {print $5}' )
146
+ P99_MICROS=$( grep $bench $file -A 4 | tail -n1 | awk ' {print $7}' )
147
+
148
+ send_to_ods rocksdb.build.$bench_key .qps $QPS
149
+ send_to_ods rocksdb.build.$bench_key .p50_micros $P50_MICROS
150
+ send_to_ods rocksdb.build.$bench_key .p75_micros $P75_MICROS
151
+ send_to_ods rocksdb.build.$bench_key .p99_micros $P99_MICROS
152
+ }
97
153
98
- send_to_ods rocksdb.build.overwrite.qps $OVERWRITE_OPS
99
- send_to_ods rocksdb.build.fillseq.qps $FILLSEQ_OPS
100
- send_to_ods rocksdb.build.readrandom.qps $READRANDOM_OPS
154
+ send_benchmark_to_ods overwrite overwrite $STAT_FILE .overwrite
155
+ send_benchmark_to_ods fillseq fillseq $STAT_FILE .fillseq
156
+ send_benchmark_to_ods readrandom readrandom $STAT_FILE .readrandom
157
+ send_benchmark_to_ods fillrandom memtablefillrandom $STAT_FILE .memtablefillreadrandom
158
+ send_benchmark_to_ods readrandom memtablereadrandom $STAT_FILE .memtablefillreadrandom
0 commit comments