Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
test server:
* database on /dev/shm
* 2 sockets, 24 CPU cores, 48 HW threads
legend:
* #thr - number of threads
* trx=n - no transaction
* trx=p - pessimistic transaction
* trx=o - optimistic transaction
* numbers are inserts per second
--- batch_size=1
- concurrent memtable disabled
#thr trx=n trx=p trx=o
1 153571 113228 101439
2 193070 182455 137708
4 167229 182313 94811
8 250508 228031 93401
12 274251 250595 92256
16 272554 266545 93403
20 281737 276026 76885
24 287475 277981 70004
28 293445 284644 48552
32 299366 288134 43672
36 303224 292887 43047
40 304027 292000 43195
44 311686 299963 44173
48 317418 308563 48482
- concurrent memtable enabled
#thr trx=n trx=p trx=o
1 152156 110235 101901
2 164778 161547 130980
4 228060 193945 116742
8 335001 311307 114802
12 401206 379568 100576
16 445484 419819 72979
20 465297 435283 45554
24 472754 451805 40381
28 490107 456741 40108
32 482851 467469 40179
36 487332 473892 39866
40 485026 457858 43587
44 481420 442169 42293
48 423738 427396 40346
--- batch_size=4
- concurrent memtable disabled
#thr trx=n trx=p trx=o
1 37838 28709 19807
2 62955 48829 30995
4 84903 72286 31754
8 95389 91310 25169
12 95297 97581 18739
16 92296 91696 17574
20 94451 91210 17319
24 91072 89522 16920
28 91429 91015 17170
32 92991 90158 17424
36 92823 89044 17332
40 91854 88994 17099
44 91766 88434 16909
48 91335 89298 16720
- concurrent memtable enabled
#thr trx=n trx=p trx=o
1 38368 28374 19783
2 63711 48045 31141
4 99853 81364 35032
8 163958 134011 28212
12 211083 175932 18142
16 243147 207610 17281
20 254355 224073 16908
24 275674 238600 16875
28 286050 247888 17215
32 281926 252813 17657
36 274349 249263 16830
40 275749 241185 16726
44 266127 234881 16506
48 267183 235147 16760
-- test script
numk=$1
totw=$2
val=$3
batch=$4
dbdir=$5
sync=$6
# sync, dbdir, concurmt, secs, dop
function runme {
a_concurmt=$1
a_dop=$2
a_extra=$3
thrw=$(( $totw / $a_dop ))
echo $a_dop threads, $thrw writes per thread
rm -rf $dbdir; mkdir $dbdir
# TODO --perf_level=0
echo ./db_bench --benchmarks=randomtransaction --use_existing_db=0 --sync=$sync --db=$dbdir --wal_dir=$dbdir --disable_data_sync=0 --num=$numk --writes=$thrw --num_levels=6 --key_size=8 --value_size=$val --block_size=4096 --cache_size=$(( 20 * 1024 * 1024 * 1024 )) --cache_numshardbits=6 --compression_type=snappy --min_level_to_compress=3 --compression_ratio=0.5 --level_compaction_dynamic_level_bytes=true --bytes_per_sync=8388608 --cache_index_and_filter_blocks=0 --benchmark_write_rate_limit=0 --hard_rate_limit=3 --rate_limit_delay_max_milliseconds=1000000 --write_buffer_size=134217728 --max_write_buffer_number=16 --target_file_size_base=33554432 --max_bytes_for_level_base=536870912 --verify_checksum=1 --delete_obsolete_files_period_micros=62914560 --max_grandparent_overlap_factor=8 --max_bytes_for_level_multiplier=8 --statistics=0 --stats_per_interval=1 --stats_interval_seconds=60 --histogram=1 --allow_concurrent_memtable_write=$a_concurmt --enable_write_thread_adaptive_yield=$a_concurmt --memtablerep=skip_list --bloom_bits=10 --open_files=-1 --level0_file_num_compaction_trigger=4 --level0_slowdown_writes_trigger=12 --level0_stop_writes_trigger=20 --max_background_compactions=16 --max_background_flushes=7 --threads=$a_dop --merge_operator="put" --seed=1454699926 --transaction_sets=$batch $a_extra
./db_bench --benchmarks=randomtransaction --use_existing_db=0 --sync=$sync --db=$dbdir --wal_dir=$dbdir --disable_data_sync=0 --num=$numk --writes=$thrw --num_levels=6 --key_size=8 --value_size=$val --block_size=4096 --cache_size=$(( 20 * 1024 * 1024 * 1024 )) --cache_numshardbits=6 --compression_type=snappy --min_level_to_compress=3 --compression_ratio=0.5 --level_compaction_dynamic_level_bytes=true --bytes_per_sync=8388608 --cache_index_and_filter_blocks=0 --benchmark_write_rate_limit=0 --hard_rate_limit=3 --rate_limit_delay_max_milliseconds=1000000 --write_buffer_size=134217728 --max_write_buffer_number=16 --target_file_size_base=33554432 --max_bytes_for_level_base=536870912 --verify_checksum=1 --delete_obsolete_files_period_micros=62914560 --max_grandparent_overlap_factor=8 --max_bytes_for_level_multiplier=8 --statistics=0 --stats_per_interval=1 --stats_interval_seconds=60 --histogram=1 --allow_concurrent_memtable_write=$a_concurmt --enable_write_thread_adaptive_yield=$a_concurmt --memtablerep=skip_list --bloom_bits=10 --open_files=-1 --level0_file_num_compaction_trigger=4 --level0_slowdown_writes_trigger=12 --level0_stop_writes_trigger=20 --max_background_compactions=16 --max_background_flushes=7 --threads=$a_dop --merge_operator="put" --seed=1454699926 --transaction_sets=$batch $a_extra
}
for dop in 1 2 4 8 12 16 20 24 28 32 36 40 44 48 ; do
# for dop in 1 24 ; do
for concurmt in 0 1 ; do
fn=o.dop${dop}.val${val}.batch${batch}.concur${concurmt}.notrx
runme $concurmt $dop "" >& $fn
q1=$( grep ^randomtransaction $fn | awk '{ print $5 }' )
t=transaction_db
fn=o.dop${dop}.val${val}.batch${batch}.concur${concurmt}.pessim
runme $concurmt $dop --${t}=1 >& $fn
q2=$( grep ^randomtransaction $fn | awk '{ print $5 }' )
t=optimistic_transaction_db
fn=o.dop${dop}.val${val}.batch${batch}.concur${concurmt}.optim
runme $concurmt $dop --${t}=1 >& $fn
q3=$( grep ^randomtransaction $fn | awk '{ print $5 }' )
echo $dop mt${concurmt} $q1 $q2 $q3 | awk '{ printf "%s\t%s\t%s\t%s\t%s\n", $1, $2, $3, $4, $5 }'
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.