run_bench.sh
application/x-shellscript
Filename: run_bench.sh
Type: application/x-shellscript
Part: 1
DURATION=300
CLIENTS="10 20 40 80 100 160 240 280"
RUNS=10
LOG="$(date +'%Y%m%d')-results.txt"
export PGDATABASE=pgbench
export PGHOST=localhost
# prewarm
psql <<EOF
SELECT sum(x.x) FROM (SELECT pg_prewarm(oid) AS x FROM pg_class WHERE relkind IN ('i', 'r') ORDER BY oid) x;
EOF
for i in `seq 1 $RUN`; do
for c in $CLIENTS; do
echo ">>>>>> clients $c <<<<<" >> $LOG
pgbench -Mprepared -T$DURATION -c $c -j $c -n -S >> $LOG
done
done