2013-01-16 21:52:37 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
NUM=10000000
|
|
|
|
|
|
|
|
if [ $# -eq 1 ];then
|
|
|
|
DATA_DIR=$1
|
|
|
|
elif [ $# -eq 2 ];then
|
|
|
|
DATA_DIR=$1
|
|
|
|
STAT_FILE=$2
|
|
|
|
fi
|
|
|
|
|
|
|
|
# On the production build servers, set data and stat
|
|
|
|
# files/directories not in /tmp or else the tempdir cleaning
|
|
|
|
# scripts will make you very unhappy.
|
2013-08-14 22:29:05 +02:00
|
|
|
DATA_DIR=${DATA_DIR:-$(mktemp -t -d rocksdb_XXXX)}
|
|
|
|
STAT_FILE=${STAT_FILE:-$(mktemp -t -u rocksdb_test_stats_XXXX)}
|
2013-01-16 21:52:37 +01:00
|
|
|
|
|
|
|
function cleanup {
|
|
|
|
rm -rf $DATA_DIR
|
|
|
|
rm -f $STAT_FILE.fillseq
|
|
|
|
rm -f $STAT_FILE.readrandom
|
|
|
|
rm -f $STAT_FILE.overwrite
|
2013-11-26 00:34:23 +01:00
|
|
|
rm -f $STAT_FILE.memtablefillreadrandom
|
2013-01-16 21:52:37 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
trap cleanup EXIT
|
2013-12-11 22:51:20 +01:00
|
|
|
|
|
|
|
if [ -z $GIT_BRANCH ]; then
|
|
|
|
git_br=`git rev-parse --abbrev-ref HEAD`
|
|
|
|
else
|
|
|
|
git_br=$(basename $GIT_BRANCH)
|
|
|
|
fi
|
|
|
|
|
2013-12-09 19:36:39 +01:00
|
|
|
if [ $git_br == "master" ]; then
|
|
|
|
git_br=""
|
2013-12-07 01:22:38 +01:00
|
|
|
else
|
2013-12-09 19:36:39 +01:00
|
|
|
git_br="."$git_br
|
2013-12-07 01:22:38 +01:00
|
|
|
fi
|
2013-01-15 05:58:51 +01:00
|
|
|
|
2013-12-11 22:51:20 +01:00
|
|
|
make release
|
2013-01-15 05:58:51 +01:00
|
|
|
|
2013-11-27 01:27:31 +01:00
|
|
|
# measure fillseq + fill up the DB for overwrite benchmark
|
2013-01-16 21:52:37 +01:00
|
|
|
./db_bench \
|
|
|
|
--benchmarks=fillseq \
|
|
|
|
--db=$DATA_DIR \
|
|
|
|
--use_existing_db=0 \
|
|
|
|
--bloom_bits=10 \
|
|
|
|
--num=$NUM \
|
|
|
|
--writes=$NUM \
|
|
|
|
--cache_size=6442450944 \
|
2013-12-11 22:51:20 +01:00
|
|
|
--cache_numshardbits=4 \
|
|
|
|
--table_cache_numshardbits=4 \
|
2013-01-16 21:52:37 +01:00
|
|
|
--open_files=55000 \
|
|
|
|
--statistics=1 \
|
|
|
|
--histogram=1 \
|
|
|
|
--disable_data_sync=1 \
|
|
|
|
--disable_wal=1 \
|
|
|
|
--sync=0 > ${STAT_FILE}.fillseq
|
2013-01-15 05:58:51 +01:00
|
|
|
|
2013-11-27 01:27:31 +01:00
|
|
|
# measure overwrite performance
|
2013-01-16 21:52:37 +01:00
|
|
|
./db_bench \
|
|
|
|
--benchmarks=overwrite \
|
|
|
|
--db=$DATA_DIR \
|
|
|
|
--use_existing_db=1 \
|
|
|
|
--bloom_bits=10 \
|
|
|
|
--num=$NUM \
|
2013-12-11 22:51:20 +01:00
|
|
|
--writes=$((NUM / 10)) \
|
2013-01-16 21:52:37 +01:00
|
|
|
--cache_size=6442450944 \
|
2013-12-11 22:51:20 +01:00
|
|
|
--cache_numshardbits=4 \
|
|
|
|
--table_cache_numshardbits=4 \
|
2013-01-16 21:52:37 +01:00
|
|
|
--open_files=55000 \
|
|
|
|
--statistics=1 \
|
|
|
|
--histogram=1 \
|
|
|
|
--disable_data_sync=1 \
|
|
|
|
--disable_wal=1 \
|
|
|
|
--sync=0 \
|
|
|
|
--threads=8 > ${STAT_FILE}.overwrite
|
2013-01-15 05:58:51 +01:00
|
|
|
|
2013-11-27 22:33:14 +01:00
|
|
|
# fill up the db for readrandom benchmark (1GB total size)
|
2013-11-27 01:27:31 +01:00
|
|
|
./db_bench \
|
|
|
|
--benchmarks=fillseq \
|
|
|
|
--db=$DATA_DIR \
|
|
|
|
--use_existing_db=0 \
|
|
|
|
--bloom_bits=10 \
|
|
|
|
--num=$NUM \
|
|
|
|
--writes=$NUM \
|
|
|
|
--cache_size=6442450944 \
|
2013-12-11 22:51:20 +01:00
|
|
|
--cache_numshardbits=4 \
|
|
|
|
--table_cache_numshardbits=4 \
|
2013-11-27 01:27:31 +01:00
|
|
|
--open_files=55000 \
|
|
|
|
--statistics=1 \
|
|
|
|
--histogram=1 \
|
|
|
|
--disable_data_sync=1 \
|
|
|
|
--disable_wal=1 \
|
|
|
|
--sync=0 \
|
|
|
|
--threads=1 > /dev/null
|
|
|
|
|
2013-11-27 22:33:14 +01:00
|
|
|
# measure readrandom with 6GB block cache
|
2013-01-16 21:52:37 +01:00
|
|
|
./db_bench \
|
|
|
|
--benchmarks=readrandom \
|
|
|
|
--db=$DATA_DIR \
|
|
|
|
--use_existing_db=1 \
|
|
|
|
--bloom_bits=10 \
|
|
|
|
--num=$NUM \
|
2013-12-11 22:51:20 +01:00
|
|
|
--reads=$((NUM / 5)) \
|
2013-01-16 21:52:37 +01:00
|
|
|
--cache_size=6442450944 \
|
2013-12-11 22:51:20 +01:00
|
|
|
--cache_numshardbits=4 \
|
|
|
|
--table_cache_numshardbits=4 \
|
2013-01-16 21:52:37 +01:00
|
|
|
--open_files=55000 \
|
2013-11-27 01:27:31 +01:00
|
|
|
--disable_seek_compaction=1 \
|
2013-01-16 21:52:37 +01:00
|
|
|
--statistics=1 \
|
|
|
|
--histogram=1 \
|
|
|
|
--disable_data_sync=1 \
|
|
|
|
--disable_wal=1 \
|
|
|
|
--sync=0 \
|
2013-12-11 22:51:20 +01:00
|
|
|
--threads=16 > ${STAT_FILE}.readrandom
|
2013-01-15 05:58:51 +01:00
|
|
|
|
2013-12-11 22:51:20 +01:00
|
|
|
# measure readrandom with 100MB block cache
|
2013-11-27 22:33:14 +01:00
|
|
|
./db_bench \
|
|
|
|
--benchmarks=readrandom \
|
|
|
|
--db=$DATA_DIR \
|
|
|
|
--use_existing_db=1 \
|
|
|
|
--bloom_bits=10 \
|
|
|
|
--num=$NUM \
|
2013-12-11 22:51:20 +01:00
|
|
|
--reads=$((NUM / 5)) \
|
|
|
|
--cache_size=104857600 \
|
|
|
|
--cache_numshardbits=4 \
|
|
|
|
--table_cache_numshardbits=4 \
|
|
|
|
--open_files=55000 \
|
|
|
|
--disable_seek_compaction=1 \
|
|
|
|
--statistics=1 \
|
|
|
|
--histogram=1 \
|
|
|
|
--disable_data_sync=1 \
|
|
|
|
--disable_wal=1 \
|
|
|
|
--sync=0 \
|
|
|
|
--threads=16 > ${STAT_FILE}.readrandomsmallblockcache
|
|
|
|
|
|
|
|
# measure readrandom with 8k data in memtable
|
|
|
|
./db_bench \
|
|
|
|
--benchmarks=overwrite,readrandom \
|
|
|
|
--db=$DATA_DIR \
|
|
|
|
--use_existing_db=1 \
|
|
|
|
--bloom_bits=10 \
|
|
|
|
--num=$NUM \
|
|
|
|
--reads=$((NUM / 5)) \
|
|
|
|
--writes=512 \
|
|
|
|
--cache_size=6442450944 \
|
|
|
|
--cache_numshardbits=4 \
|
|
|
|
--table_cache_numshardbits=4 \
|
|
|
|
--write_buffer_size=1000000000 \
|
|
|
|
--open_files=55000 \
|
|
|
|
--disable_seek_compaction=1 \
|
|
|
|
--statistics=1 \
|
|
|
|
--histogram=1 \
|
|
|
|
--disable_data_sync=1 \
|
|
|
|
--disable_wal=1 \
|
|
|
|
--sync=0 \
|
|
|
|
--threads=16 > ${STAT_FILE}.readrandom_mem_sst
|
|
|
|
|
|
|
|
|
|
|
|
# fill up the db for readrandom benchmark with filluniquerandom (1GB total size)
|
|
|
|
./db_bench \
|
|
|
|
--benchmarks=filluniquerandom \
|
|
|
|
--db=$DATA_DIR \
|
|
|
|
--use_existing_db=0 \
|
|
|
|
--bloom_bits=10 \
|
|
|
|
--num=$((NUM / 4)) \
|
|
|
|
--writes=$((NUM / 4)) \
|
|
|
|
--cache_size=6442450944 \
|
|
|
|
--cache_numshardbits=4 \
|
|
|
|
--table_cache_numshardbits=4 \
|
|
|
|
--open_files=55000 \
|
|
|
|
--statistics=1 \
|
|
|
|
--histogram=1 \
|
|
|
|
--disable_data_sync=1 \
|
|
|
|
--disable_wal=1 \
|
|
|
|
--sync=0 \
|
|
|
|
--threads=1 > /dev/null
|
|
|
|
|
|
|
|
# measure readrandom after load with filluniquerandom with 6GB block cache
|
|
|
|
./db_bench \
|
|
|
|
--benchmarks=readrandom \
|
|
|
|
--db=$DATA_DIR \
|
|
|
|
--use_existing_db=1 \
|
|
|
|
--bloom_bits=10 \
|
|
|
|
--num=$((NUM / 4)) \
|
|
|
|
--reads=$((NUM / 4)) \
|
|
|
|
--cache_size=6442450944 \
|
|
|
|
--cache_numshardbits=4 \
|
|
|
|
--table_cache_numshardbits=4 \
|
2013-11-27 22:33:14 +01:00
|
|
|
--open_files=55000 \
|
|
|
|
--disable_seek_compaction=1 \
|
2013-12-11 22:51:20 +01:00
|
|
|
--disable_auto_compactions=1 \
|
2013-11-27 22:33:14 +01:00
|
|
|
--statistics=1 \
|
|
|
|
--histogram=1 \
|
|
|
|
--disable_data_sync=1 \
|
|
|
|
--disable_wal=1 \
|
|
|
|
--sync=0 \
|
2013-12-11 22:51:20 +01:00
|
|
|
--threads=16 > ${STAT_FILE}.readrandom_filluniquerandom
|
2013-11-27 22:33:14 +01:00
|
|
|
|
2013-11-27 01:27:31 +01:00
|
|
|
# measure memtable performance -- none of the data gets flushed to disk
|
2013-11-26 00:34:23 +01:00
|
|
|
./db_bench \
|
|
|
|
--benchmarks=fillrandom,readrandom, \
|
|
|
|
--db=$DATA_DIR \
|
|
|
|
--use_existing_db=0 \
|
|
|
|
--num=$((NUM / 10)) \
|
|
|
|
--reads=$NUM \
|
|
|
|
--cache_size=6442450944 \
|
2013-12-11 22:51:20 +01:00
|
|
|
--cache_numshardbits=4 \
|
|
|
|
--table_cache_numshardbits=4 \
|
2013-11-26 00:34:23 +01:00
|
|
|
--write_buffer_size=1000000000 \
|
|
|
|
--open_files=55000 \
|
|
|
|
--disable_seek_compaction=1 \
|
|
|
|
--statistics=1 \
|
|
|
|
--histogram=1 \
|
|
|
|
--disable_data_sync=1 \
|
|
|
|
--disable_wal=1 \
|
|
|
|
--sync=0 \
|
|
|
|
--value_size=10 \
|
2013-12-11 22:51:20 +01:00
|
|
|
--threads=16 > ${STAT_FILE}.memtablefillreadrandom
|
2013-11-26 00:34:23 +01:00
|
|
|
|
2013-11-27 01:27:31 +01:00
|
|
|
# send data to ods
|
|
|
|
function send_to_ods {
|
|
|
|
key="$1"
|
|
|
|
value="$2"
|
|
|
|
|
2013-12-11 22:51:20 +01:00
|
|
|
if [ -z $JENKINS_HOME ]; then
|
|
|
|
# running on devbox, just print out the values
|
|
|
|
echo $1 $2
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
|
2013-11-27 01:27:31 +01:00
|
|
|
if [ -z "$value" ];then
|
|
|
|
echo >&2 "ERROR: Key $key doesn't have a value."
|
|
|
|
return
|
|
|
|
fi
|
2013-12-09 19:36:39 +01:00
|
|
|
curl -s "https://www.intern.facebook.com/intern/agent/ods_set.php?entity=rocksdb_build$git_br&key=$key&value=$value" \
|
2013-11-27 01:27:31 +01:00
|
|
|
--connect-timeout 60
|
|
|
|
}
|
|
|
|
|
|
|
|
function send_benchmark_to_ods {
|
|
|
|
bench="$1"
|
|
|
|
bench_key="$2"
|
|
|
|
file="$3"
|
|
|
|
|
|
|
|
QPS=$(grep $bench $file | awk '{print $5}')
|
|
|
|
P50_MICROS=$(grep $bench $file -A 4 | tail -n1 | awk '{print $3}' )
|
|
|
|
P75_MICROS=$(grep $bench $file -A 4 | tail -n1 | awk '{print $5}' )
|
|
|
|
P99_MICROS=$(grep $bench $file -A 4 | tail -n1 | awk '{print $7}' )
|
|
|
|
|
|
|
|
send_to_ods rocksdb.build.$bench_key.qps $QPS
|
|
|
|
send_to_ods rocksdb.build.$bench_key.p50_micros $P50_MICROS
|
|
|
|
send_to_ods rocksdb.build.$bench_key.p75_micros $P75_MICROS
|
|
|
|
send_to_ods rocksdb.build.$bench_key.p99_micros $P99_MICROS
|
|
|
|
}
|
|
|
|
|
|
|
|
send_benchmark_to_ods overwrite overwrite $STAT_FILE.overwrite
|
|
|
|
send_benchmark_to_ods fillseq fillseq $STAT_FILE.fillseq
|
|
|
|
send_benchmark_to_ods readrandom readrandom $STAT_FILE.readrandom
|
2013-11-27 22:33:14 +01:00
|
|
|
send_benchmark_to_ods readrandom readrandom_smallblockcache $STAT_FILE.readrandomsmallblockcache
|
2013-12-11 22:51:20 +01:00
|
|
|
send_benchmark_to_ods readrandom readrandom_memtable_sst $STAT_FILE.readrandom_mem_sst
|
|
|
|
send_benchmark_to_ods readrandom readrandom_fillunique_random $STAT_FILE.readrandom_filluniquerandom
|
2013-11-27 01:27:31 +01:00
|
|
|
send_benchmark_to_ods fillrandom memtablefillrandom $STAT_FILE.memtablefillreadrandom
|
|
|
|
send_benchmark_to_ods readrandom memtablereadrandom $STAT_FILE.memtablefillreadrandom
|