\
\
"pgbench postgresql on ubuntu from scratch"
Install postgresql
sudo apt-get install postgresql
Change to postgres user
sudo su postgres
Create an empty database
createdb pgbench
Fill the size of the db with 231MB
pgbench -i -s 15 pgbench
Check the size
psql pgbench -c "\l+" | grep pgbench | awk -F "|" '{print $7}'
Read write test
pgbench -c 4 -j 2 -T 60 pgbench
Read only test
pgbench -c 4 -j 2 -T 600 -S pgbench
Write only test
pgbench -c 4 -j 2 -T 60 -N pgbench
-c are the number of concurrent session -j are the threads -T time of the bench in second
[me@blog]$
_