Archive for the ‘postgres’ Category

Benchmarking with PGBench: TPS results.

pgbench is not the best tools to benchmark postgres but it’s
the one shipped by default with postgres.
It does not do a good job for benchmarking your “web apps” SQL wise, it will give you some
good indication about how fast is your server for postgres.
Here are some results we have collected using theses options :

pgbench -Uuser [...]

Read the rest of this entry »

Get size of Postgres DB from filesystem

Get the size accurately from postgres local filesystem, i guess there is some sql stuff that can do that but that does the job as well for me :

#!/bin/bash
/usr/lib/postgresql/8.1/bin/oid2name -U postgres|while read -a e;do
name=${e[1]}
oid=${e[0]}
[[ $oid == "All" || $oid == "Oid" || -z $oid || -z $name ]] && continue
typeset -a size
size=(`du -s /var/lib/postgresql/8.1/main/base/$oid`)
size=${size[0]}
printf [...]

Read the rest of this entry »