Created
October 25, 2018 18:49
-
-
Save mdcallag/4074fa6642b3932f2f94979e8eb04b17 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
j=$1 | |
nr=$2 | |
cpri=$3 | |
dyn=$4 | |
secs=$5 | |
dname=$6 | |
vsz=$7 | |
dbdir="./rdb" | |
myargs="--max_background_jobs=$j --compaction_pri=$cpri --level_compaction_dynamic_level_bytes=$dyn" | |
defargs="--key_size=20 --value_size=$vsz -stats_interval_seconds=10 --stats_per_interval=1 --rate_limiter_bytes_per_sec=$(( 1024 * 1024 * 4 )) " | |
sfx=j${j}.pri${cpri}.dyn${dyn} | |
./db_bench --benchmarks="fillrandom,readrandom,stats" --use_existing_db=0 --db=$dbdir --num=$nr $defargs $myargs >& ow.$sfx & | |
bid=$! | |
sleep 5 | |
while ! grep ^fillrandom ow.$sfx ; do | |
sleep 1 | |
done | |
echo found at $( date ) | |
vmstat 1 >& vw.$sfx & | |
vpid=$! | |
iostat -kx 1 >& iw.$sfx & | |
ipid=$! | |
wait $bid | |
echo done at $( date ) | |
kill $vpid | |
kill $ipid | |
du -hs $dbdir > dw.$sfx | |
echo iostat metrics > hw.$sfx | |
printf "Nsamp\tr/s\trMB/s\tw/s\twMB/s\trGB\twGB\tr/i\tw/i\trkb/i\twkb/i\tMrows\n" >> hw.$sfx | |
c=$( grep -a $dname iw.$sfx | wc -l ) | |
grep -a $dname iw.$sfx | tail -$(( $c - 1 )) > tmp.iw | |
cat tmp.iw | awk '{ rs += $4; ws += $5; rkb += $6; wkb += $7; c += 1 } END { printf "%s\t%.0f\t%.1f\t%.0f\t%.1f\t%.1f\t%.1f\t%.5f\t%.5f\t%.5f\t%.5f\t%.1f\n", c, rs/c, rkb/1024.0/c, ws/c, wkb/1024.0/c, rkb/(1024*1024.0), wkb/(1024*1024.0), rs/c/q, rkb/c/q, ws/c/q, wkb/c/q, q/1000000.0 }' q=$nr >> hw.$sfx | |
c=$( grep -av swpd vw.$sfx | wc -l ) | |
grep -av swpd vw.$sfx | tail -$(( $c - 1 )) > tmp.vw | |
echo >> hw.$sfx | |
echo vmstat metrics >> hw.$sfx | |
printf "samp\tcs/s\tcpu/c\tcs/q\tcpu/q\n" >> hw.$sfx | |
cat tmp.vw | awk '{ cs += $12; cpu += $13 + $14; c += 1 } END { printf "%s\t%.0f\t%.1f\t%.3f\t%.6f\n", c, cs/c, cpu/c, cs/c/q, cpu/c/q }' q=$nr>> hw.$sfx | |
w1=$( grep -a "^Cumulative compaction" ow.$sfx | tail -1 | awk '{ print $3 }' ) | |
r1=$( grep -a "^Cumulative compaction" ow.$sfx | tail -1 | awk '{ print $9 }' ) | |
echo "w1 r1" >> hw.$sfx | |
echo $w1 $r1 >> hw.$sfx |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment