#!/bin/sh
# mybench.sh
HOST=localhost
USER=postgres
DB=pgbench
totxacts=1000
for c in 10
do
        t=`expr $totxacts / $c`
        psql -h $HOST -U $USER -c 'vacuum analyze' $DB
        psql -h $HOST -U $USER -c 'checkpoint' $DB
        echo "===== sync ======" 1>&2
        sync;sync;sync;sleep 10
        echo $c concurrent users... 1>&2
        /usr/bin/pgbench -n -U $USER -t $t -h $HOST -c $c $DB
done

