View gist:a859908a58d7243051aced4197250f13
rw1.sh to setup database
./db_bench --benchmarks=fillseq --num=$1 --db=./ldb --statistics=$3 --stats_per_interval=0 --stats_interval_seconds=10 --cache_size=10737418240 --disable_wal=1 --compression_type=none --threads=1 --level_compaction_dynamic_level_bytes=1 --max_background_compactions=8 --max_background_flushes=3 --max_write_buffer_number=4 --write_buffer_size=33554432 --bytes_per_sync=4194304 --max_bytes_for_level_base=134217728 --memtablerep=$2
./db_bench --benchmarks=overwrite --num=$1 --db=./ldb --statistics=$3 --stats_per_interval=0 --stats_interval_seconds=10 --cache_size=10737418240 --disable_wal=1 --compression_type=none --threads=1 --level_compaction_dynamic_level_bytes=1 --max_background_compactions=8 --max_background_flushes=3 --max_write_buffer_number=4 --write_buffer_size=33554432 --bytes_per_sync=4194304 --max_bytes_for_level_base=134217728 --memtablerep=$2 --use_existing_db=1 --duration=60
ro2.sh to run readonly test
./db_bench --benchmarks=readrandom --num=$1 --db=./ldb --statistics=$3
View gist:56253a09d8278d582e60e575e1320c91
rw1.sh - to setup database
./db_bench --benchmarks=fillseq --num=$1 --db=./ldb --statistics=$3 --stats_per_interval=0 --stats_interval_seconds=10 --cache_size=10737418240 --disable_wal=1 --compression_type=none --threads=1 --level_compaction_dynamic_level_bytes=1 --max_background_compactions=8 --max_background_flushes=3 --max_write_buffer_number=4 --write_buffer_size=33554432 --bytes_per_sync=4194304 --max_bytes_for_level_base=134217728 --memtablerep=$2
./db_bench --benchmarks=overwrite --num=$1 --db=./ldb --statistics=$3 --stats_per_interval=0 --stats_interval_seconds=10 --cache_size=10737418240 --disable_wal=1 --compression_type=none --threads=1 --level_compaction_dynamic_level_bytes=1 --max_background_compactions=8 --max_background_flushes=3 --max_write_buffer_number=4 --write_buffer_size=33554432 --bytes_per_sync=4194304 --max_bytes_for_level_base=134217728 --memtablerep=$2 --use_existing_db=1 --duration=60
rw2.sh - to run readwhilewriting QPS
./db_bench --benchmarks=readwhilewriting --num=$1 --db=./ldb
View gist:ca1da5f7a34a64c0e14359a113ef21e1
./db_bench --benchmarks=fillseq --num=$1 --db=./ldb --statistics=$3 --stats_per_interval=0 --stats_interval_seconds=10 --cache_size=10737418240 --disable_wal=1 --compression_type=none --threads=1 --level_compaction_dynamic_level_bytes=1 --max_background_compactions=8 --max_background_flushes=3 --max_write_buffer_number=4 --write_buffer_size=33554432 --bytes_per_sync=4194304 --max_bytes_for_level_base=134217728 --memtablerep=$2
View gist:37e3eccf4726bc9424556ce75dbb6ac3
Performance counter stats for 'system wide':
20006.680120 task-clock (msec) # 4.001 CPUs utilized (100.00%)
190,004 context-switches # 0.009 M/sec (100.00%)
37 cpu-migrations # 0.002 K/sec (100.00%)
105 page-faults # 0.005 K/sec
12,317,561,262 cycles # 0.616 GHz (100.00%)
<not supported> stalled-cycles-frontend
<not supported> stalled-cycles-backend
7,794,537,441 instructions # 0.63 insns per cycle (100.00%)
View gist:f1dd8d336bb9d9b39eaeaf28f5864176
Performance counter stats for 'system wide':
20074.324339 cpu-clock (msec) # 4.014 CPUs utilized
362,603 context-switches # 0.018 M/sec
54 cpu-migrations # 0.003 K/sec
63 page-faults # 0.003 K/sec
20,784,760,982 cycles # 1.035 GHz
15,064,212,944 instructions # 0.72 insn per cycle
2,274,781,557 branches # 113.318 M/sec
25,975,399 branch-misses # 1.14% of all branches
View gist:5d8d7fc0510d1735376879ef4fdee590
Performance counter stats for 'system wide':
20004.993272 task-clock (msec) # 4.000 CPUs utilized (100.00%)
361,620 context-switches # 0.018 M/sec (100.00%)
101 cpu-migrations # 0.005 K/sec (100.00%)
124 page-faults # 0.006 K/sec
12,416,510,535 cycles # 0.621 GHz (100.00%)
<not supported> stalled-cycles-frontend
<not supported> stalled-cycles-backend
7,513,804,548 instructions # 0.61 insns per cycle (100.00%)
View gist:146d8a439f780ecf05f6090fad62114b
Performance counter stats for 'system wide':
20075.779939 cpu-clock (msec) # 4.015 CPUs utilized
363,905 context-switches # 0.018 M/sec
65 cpu-migrations # 0.003 K/sec
64 page-faults # 0.003 K/sec
20,977,372,189 cycles # 1.045 GHz
14,750,183,807 instructions # 0.70 insn per cycle
2,223,395,074 branches # 110.750 M/sec
26,761,943 branch-misses # 1.20% of all branches
View gist:a675e113e915a8f2e3c06282c464bd83
secs=$1
ts=$( date +'%m%d_%H%M%S' )
perf stat -a sleep $secs > p.${ts} 2>&1
perf stat -e cycles,instructions,cache-references,cache-misses,bus-cycles -a sleep $secs >> p.${ts} 2>&1
perf stat -e 'syscalls:sys_enter_*' -a sleep $secs >> p.${ts} 2>&1
perf stat -e L1-dcache-loads,L1-dcache-load-misses,L1-dcache-stores -a sleep $secs >> p.${ts} 2>&1
perf stat -e dTLB-loads,dTLB-load-misses,dTLB-prefetch-misses -a sleep $secs >> p.${ts} 2>&1
perf stat -e LLC-loads,LLC-load-misses,LLC-stores,LLC-prefetches -a sleep $secs >> p.${ts} 2>&1
View gist:0eac7039cb8b874d2a3a92e5f5b72ffd
Performance counter stats for 'system wide':
20003.362033 task-clock (msec) # 4.000 CPUs utilized (100.00%)
394,209 context-switches # 0.020 M/sec (100.00%)
171 cpu-migrations # 0.009 K/sec (100.00%)
114 page-faults # 0.006 K/sec
12,481,647,384 cycles # 0.624 GHz (100.00%)
<not supported> stalled-cycles-frontend
<not supported> stalled-cycles-backend
7,571,850,559 instructions # 0.61 insns per cycle (100.00%)
View gist:a9d26e611764709dfaa26d2a8477ab76
Performance counter stats for 'system wide':
20074.702970 cpu-clock (msec) # 4.014 CPUs utilized
670,466 context-switches # 0.033 M/sec
97 cpu-migrations # 0.005 K/sec
62 page-faults # 0.003 K/sec
21,348,783,249 cycles # 1.063 GHz
13,349,882,820 instructions # 0.63 insn per cycle
2,582,546,945 branches # 128.647 M/sec
14,490,145 branch-misses # 0.56% of all branches