Benchmarking
I need to check the scalability of a machine with postgresql and Im doing it
with pgbench but Im getting values with a variation of a 40% with the same
pgbench call...
Just the same variation if I restart posgresql or overwrite the db...
So just wondering if theres another benchmarking tool for postgres...
Perhaps should I write my own one?
I need to check the scalability of a machine with postgresql and Im doing it
with pgbench but Im getting values with a variation of a 40% with the same
pgbench call...
You might be looking at the effect of the kernel buffer cache. Try run
pgbench several times with same settings. Another point is how many
transactions pgbench runs (-t option). More transactions would give
more statble results. Here is my small script to run pgbench. I
usually run it 2 or 3 times and take only the last run result.
#! /bin/sh
pgbench -i -s 2 test
for i in 1 2 4 8 16 32 64 128
do
t=`expr 640 / $i`
pgbench -t $t -c $i test
echo "===== sync ======"
sync;sync;sync;sleep 10
echo "===== sync done ======"
done
#! /bin/sh
pgbench -i -s 2 test
for i in 1 2 4 8 16 32 64 128
do
t=`expr 640 / $i`
pgbench -t $t -c $i test
echo "===== sync ======"
With 7.1 you will probably want a checkpoint instead of sync here:
psql -c "checkpoint;" template1 ; sleep 10
The sync does not help, since the pages are not yet written.
sync;sync;sync;sleep 10
echo "===== sync done ======"
done
Andreas
Import Notes
Resolved by subject fallback
#! /bin/sh
pgbench -i -s 2 test
for i in 1 2 4 8 16 32 64 128
do
t=`expr 640 / $i`
pgbench -t $t -c $i test
echo "===== sync ======"With 7.1 you will probably want a checkpoint instead of sync here:
psql -c "checkpoint;" template1 ; sleep 10
The sync does not help, since the pages are not yet written.
Good point. I have been used it since 7.0 and forgot to update for
7.1.
--
Tatsuo Ishii