Skip to content

Instantly share code, notes, and snippets.

@dreness dreness/iops
Created Jul 3, 2014

Embed
What would you like to do?
pgbench on 6c 2013 mac pro, internal SSD: 35,000+ iops, 12430 transactions per second.
# make a new DB, in this case at ~/tmpdb, which is on the mac pro's internal SSD (disk0)
% ./bin/initdb -D ~/tmpdb
# set checkpoint_segments to 32 in postgres.conf, then start DB.
% ./bin/postgres -D /Users/andre/tmpdb
LOG: database system was shut down at 2014-07-03 11:49:38 PDT
LOG: database system is ready to accept connections
LOG: autovacuum launcher started
# initialize the DB for use by pgbench, with a scale factor of 200. pgbench is probably not installed, but it's in the PostgreSQL source directory under contrib/pgbench.
% cd contrib/pgbench ; ./pgbench -i -s 200
creating tables...
100000 of 20000000 tuples (0%) done (elapsed 0.07 s, remaining 14.68 s).
200000 of 20000000 tuples (1%) done (elapsed 0.15 s, remaining 15.20 s).
300000 of 20000000 tuples (1%) done (elapsed 0.23 s, remaining 14.99 s).
...
19800000 of 20000000 tuples (99%) done (elapsed 25.81 s, remaining 0.26 s).
19900000 of 20000000 tuples (99%) done (elapsed 26.06 s, remaining 0.13 s).
20000000 of 20000000 tuples (100%) done (elapsed 26.31 s, remaining 0.00 s).
vacuum...
set primary keys...
done.
# This results in a DB of about 4.3 GB
% du -sh ~/tmpdb
4.3G /Users/andre/tmpdb
# Run pgbench for 10 seconds with 14 clients (processes), using two threads each. Vacuum all tables prior to starting the benchmark.
% ./pgbench -T 10 -c 14 -j 2 -v
starting vacuum...end.
starting vacuum pgbench_accounts...end.
transaction type: TPC-B (sort of)
scaling factor: 200
query mode: simple
number of clients: 14
number of threads: 2
duration: 10 s
number of transactions actually processed: 124927
tps = 12430.767431 (including connections establishing)
tps = 12449.323445 (excluding connections establishing)
# During the above run, iostat -w1 disk0:
disk0 cpu load average
KB/t tps MB/s us sy id 1m 5m 15m
7.83 23 0.18 0 0 100 3.70 2.85 2.49
# vacuum starts
24.85 2103 51.04 2 2 96 3.70 2.85 2.49
22.37 8219 179.54 4 5 91 3.56 2.83 2.49
26.29 7066 181.41 5 5 90 3.56 2.83 2.49
29.14 5294 150.63 4 4 92 3.56 2.83 2.49
25.04 6700 163.83 5 5 91 3.56 2.83 2.49
20.10 9888 194.14 4 6 90 3.56 2.83 2.49
23.17 7880 178.28 5 5 90 3.44 2.82 2.49
14.23 33987 472.15 4 11 86 3.44 2.82 2.49
67.12 402 26.32 8 2 90 3.44 2.82 2.49
17.34 8536 144.53 52 31 17 3.44 2.82 2.49
# vacuum finishes, benchmark starts
14.31 14173 198.02 58 36 6 3.44 2.82 2.49
13.18 22618 291.23 54 36 10 3.72 2.89 2.51
14.13 17489 241.35 56 35 9 3.72 2.89 2.51
14.95 14119 206.07 58 36 6 3.72 2.89 2.51
14.66 13962 199.90 58 35 7 3.72 2.89 2.51
14.41 14194 199.79 58 35 6 3.72 2.89 2.51
15.02 13946 204.61 58 35 7 3.66 2.89 2.52
12.08 35218 415.34 53 38 9 3.66 2.89 2.52
15.28 13411 200.08 61 33 6 3.66 2.89 2.52
13.76 1906 25.61 7 10 83 3.66 2.89 2.52
# benchmark finishes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.