#! /usr/bin/bash DURATION=300 DURATION2=1500 ROOT=/home/horiguti BIN1PATH=$ROOT/bin/pgsql_master_o2/bin BIN2PATH=$ROOT/bin/pgsql_shmemstat/bin DATAPATH=$ROOT/data/data_shmemstat run() { local BINARY=$1 echo "## $BINARY-A1" pgbench -j 1 -c 1 -T $DURATION -b select-only postgres echo "## $BINARY-B1" pgbench -j 100 -c 100 -T $DURATION -b select-only postgres echo "## $BINARY-C1" pgbench -j 1 -c 1 -T $DURATION -f tr.sql postgres echo "## $BINARY-D1" pgbench -j 100 -c 100 -T $DURATION -f tr.sql postgres echo "## $BINARY-A2" ((pgbench -j 1 -c 1 -T $DURATION -f ref.sql postgres | sed -e 's/^/1:/') & (pgbench -j 1 -c 1 -T $DURATION -b select-only postgres | sed -e 's/^/2:/')); sleep 1 echo "## $BINARY-B2" ((pgbench -j 1 -c 1 -T $DURATION -f ref.sql postgres | sed -e 's/^/1:/') & (pgbench -j 97 -c 97 -T $DURATION -b select-only postgres | sed -e 's/^/2:/')); sleep 1 echo "## $BINARY-C2" ((pgbench -j 1 -c 1 -T $DURATION -f ref.sql postgres | sed -e 's/^/1:/') & (pgbench -j 1 -c 1 -T $DURATION -f tr.sql postgres | sed -e 's/^/2:/')); sleep 1 echo "## $BINARY-D2" ((pgbench -j 1 -c 1 -T $DURATION -f ref.sql postgres | sed -e 's/^/1:/') & (pgbench -j 97 -c 97 -T $DURATION -f tr.sql postgres | sed -e 's/^/2:/')); sleep 1 } $BIN1PATH/pg_ctl -D $DATAPATH start run "o2" $BIN1PATH/pg_ctl -D $DATAPATH stop -m s $BIN2PATH/pg_ctl -D $DATAPATH start run "shmem" $BIN2PATH/pg_ctl -D $DATAPATH stop -m s