Sunday, April 14, 2013

PostgreSQL DB benchmarking

Creating DB benchmarking ---> pgbench -i -s 10 pgbench1

1. Benchmarking with pgbench

root@devel:/etc/pgbouncer# /usr/lib/postgresql/9.0/bin/pgbench -c 10 -C -T 60 -p 9999 -U postgres pgbench
starting vacuum...end.
transaction type: TPC-B (sort of)
scaling factor: 10
query mode: simple
number of clients: 10
number of threads: 1
duration: 60 s
number of transactions actually processed: 19034
tps = 317.123852 (including connections establishing)
tps = 387.216036 (excluding connections establishing)

2. Benchmarking without pgbench


root@mondb1:/etc/postgresql/9.0/main# /usr/lib/postgresql/9.0/bin/pgbench -c 10 -C -T 60 -p 5432 -h localhost -U postgres pgbench
Password:
starting vacuum...end.
transaction type: TPC-B (sort of)
scaling factor: 10
query mode: simple
number of clients: 10
number of threads: 1
duration: 60 s
number of transactions actually processed: 1444
tps = 24.021847 (including connections establishing)
tps = 209.524453 (excluding connections establishing)


3. Script for benchmarking

#!/bin/bash
for i in 1 2 3 4 5 6 7 8 9 10
do
    /usr/lib/postgresql/9.0/bin/pgbench -c 10 -C -T 60 -p 5432 -U postgres -h localhost pgbench >> benchmark.txt 
done

No comments:

Post a Comment