ページ更新: 2004-08-09 (月) (5515日前)

pgbenchについてのメモ。

今回の目的。

  • PostgreSQLの簡単な動作確認として。
  • 大体の速度の目安。2〜3倍違っていても気にしない。

see /usr/share/doc/postgresql-7.4.3/contrib/README.pgbench*

[編集]

Pentium4 2.6 (HT), Windows XP Professional SP1 - Cygwin 1.5.10 #

OS

$ uname -a
CYGWIN_NT-5.1 hostname 1.5.10(0.116/4/2) 2004-05-25 22:07 i686 unknown unknown Cygwin

CPUINFO

$ cat /proc/cpuinfo
processor       : 0
vendor_id       : GenuineIntel
type            : primary processor
cpu family      : 15
model           : 2
model name      :               Intel(R) Pentium(R) 4 CPU 2.60GHz
stepping        : 9
brand id        : 9
cpu count       : 2
apic id         : 0
cpu MHz         : 2595
fpu             : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov
pat pse36 clfl dtes acpi mmx fxsr sse sse2 ss htt tmi pbe cid
processor       : 1
vendor_id       : GenuineIntel
type            : primary processor
cpu family      : 15
model           : 2
model name      :               Intel(R) Pentium(R) 4 CPU 2.60GHz
stepping        : 9
brand id        : 9
cpu count       : 2
apic id         : 1
cpu MHz         : 2595
fpu             : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov
pat pse36 clfl dtes acpi mmx fxsr sse sse2 ss htt tmi pbe cid

メモリ

$ free
Unknown HZ value! (500) Assume 100.
             total       used       free     shared    buffers     cached
Mem:       1048044     494320     553724          0          0          0
-/+ buffers/cache:     494320     553724
Swap:      2097152      41228    2055924

パッケージ

$ cygcheck -cd postgresql cygwin
Cygwin Package Information
Package              Version
cygwin               1.5.10-3
postgresql           7.4.3-1

pgbench

$ createdb pgbench
CREATE DATABASE

$ pgbench -i pgbench
creating tables...
10000 tuples done.
20000 tuples done.
30000 tuples done.
40000 tuples done.
50000 tuples done.
60000 tuples done.
70000 tuples done.
80000 tuples done.
90000 tuples done.
100000 tuples done.
set primary key...
NOTICE:  ALTER TABLE / ADD PRIMARY KEY will create implicit index "branches_pkey
" for table "branches"
NOTICE:  ALTER TABLE / ADD PRIMARY KEY will create implicit index "tellers_pkey"
 for table "tellers"
NOTICE:  ALTER TABLE / ADD PRIMARY KEY will create implicit index "accounts_pkey
" for table "accounts"
vacuum...done.

$ pgbench pgbench
starting vacuum...end.
transaction type: TPC-B (sort of)
scaling factor: 1
number of clients: 1
number of transactions per client: 10
number of transactions actually processed: 10/10
tps = 26.385224 (including connections establishing)
tps = 30.487805 (excluding connections establishing)

$ pgbench -t 100 -c 8 pgbench
starting vacuum...end.
transaction type: TPC-B (sort of)
scaling factor: 1
number of clients: 8
number of transactions per client: 100
number of transactions actually processed: 800/800
tps = 26.403512 (including connections establishing)
tps = 26.844737 (excluding connections establishing)

$ pgbench -h localhost pgbench
starting vacuum...end.
transaction type: TPC-B (sort of)
scaling factor: 1
number of clients: 1
number of transactions per client: 10
number of transactions actually processed: 10/10
tps = 23.980815 (including connections establishing)
tps = 27.247956 (excluding connections establishing)

$ pgbench -h localhost -t 100 -c 8 pgbench
starting vacuum...end.
transaction type: TPC-B (sort of)
scaling factor: 1
number of clients: 8
number of transactions per client: 100
number of transactions actually processed: 800/800
tps = 29.237629 (including connections establishing)
tps = 29.728725 (excluding connections establishing)
[編集]

Pentium4 2.6 (HT), Windows XP Professional SP1 - VMware 4.5.2 - Windows 2000 Professional SP4 - Cygwin 1.5.10 #

おまけ。WinXPでVMware動かして、その中で Win2000動かして、その中で Cygwin 動かした。

$ pgbench pgbench
starting vacuum...end.
transaction type: TPC-B (sort of)
scaling factor: 1
number of clients: 1
number of transactions per client: 10
number of transactions actually processed: 10/10
tps = 26.666667 (including connections establishing)
tps = 39.370079 (excluding connections establishing)

$ pgbench -h localhost -t 100 -c 8 pgbench
starting vacuum...end.
transaction type: TPC-B (sort of)
scaling factor: 1
number of clients: 8
number of transactions per client: 100
number of transactions actually processed: 800/800
tps = 30.650167 (including connections establishing)
tps = 31.761156 (excluding connections establishing)
[編集]

AMD K6-2 450, Debian GNU/Linux Sarge, kernel 2.4.26-1-k6 #

おまけ。Linux 上で PostgreSQL を稼働。ただし、CPUは遅め。(PC/Dynabook Satellite 2140

$ uname -a
Linux hostname 2.4.26-1-k6 #1 Sat May 1 20:32:03 EST 2004 i586 GNU/Linux

$ dpkg -s postgresql | grep Version
Version: 7.4.2-4

$ dpkg -s postgresql-contrib | grep Version
Version: 7.4.2-4
$ cat /proc/cpuinfo
processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 5
model           : 8
model name      : AMD-K6(tm) 3D processor
stepping        : 12
cpu MHz         : 451.031
cache size      : 64 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu vme de pse tsc msr mce cx8 pge mmx syscall 3dnow k6_mtrr
bogomips        : 901.12

$ free
             total       used       free     shared    buffers     cached
Mem:        192076     169936      22140          0      11420      89804
-/+ buffers/cache:      68712     123364
Swap:       999928       5792     994136
$ /usr/lib/postgresql/bin/pgbench pgbench
starting vacuum...end.
transaction type: TPC-B (sort of)
scaling factor: 1
number of clients: 1
number of transactions per client: 10
number of transactions actually processed: 10/10
tps = 61.431476 (including connections establishing)
tps = 69.395771 (excluding connections establishing)
$ /usr/lib/postgresql/bin/pgbench -h localhost -t 100 -c 8 pgbench
starting vacuum...end.
transaction type: TPC-B (sort of)
scaling factor: 1
number of clients: 8
number of transactions per client: 100
number of transactions actually processed: 800/800
tps = 66.432542 (including connections establishing)
tps = 67.197832 (excluding connections establishing)
[編集]

Pentium4 2.6 (HT), Windows XP Professional SP1 - coLinux 0.6.1-2.4.26 - Debian GNU/Linux 3.0 #

おまけ。Windows XP 上で coLinux を動かし、そこで PostgreSQL を動かした。

$ /usr/lib/postgresql/bin/pgbench pgbench
starting vacuum...end.
transaction type: TPC-B (sort of)
scaling factor: 1
number of clients: 1
number of transactions per client: 10
number of transactions actually processed: 10/10
tps = 299.499835(including connections establishing)
tps = 384.748567(excluding connections establishing)
$ /usr/lib/postgresql/bin/pgbench -t 100 -c 8 pgbench
starting vacuum...end.
transaction type: TPC-B (sort of)
scaling factor: 1
number of clients: 8
number of transactions per client: 100
number of transactions actually processed: 800/800
tps = 314.895791(including connections establishing)
tps = 321.011958(excluding connections establishing)
[編集]

XP SP1, Pentium4 2.8 (not HT), HDD 200GB - Cygwin 1.5.10 #

$ pgbench pgbench
starting vacuum...end.
transaction type: TPC-B (sort of)
scaling factor: 1
number of clients: 1
number of transactions per client: 10
number of transactions actually processed: 10/10
tps = 77.519380 (including connections establishing)
tps = 109.890110 (excluding connections establishing)
$ pgbench -h localhost -t 100 -c 8 pgbench
starting vacuum...end.
transaction type: TPC-B (sort of)
scaling factor: 1
number of clients: 8
number of transactions per client: 100
number of transactions actually processed: 800/800
tps = 91.439022 (including connections establishing)
tps = 95.362975 (excluding connections establishing)