[root@miracle uploads]# rpm -ivh pgpool-2.0.8-1vl1.i386.rpm
Preparing... ########################################### [100%]
1:pgpool ########################################### [100%]
[root@miracle uploads]# rpm -q postgresql
postgresql-7.4-5
root@miracle bin]# /etc/rc.d/init.d/pgpool start
Starting pgpool: ok
[root@miracle bin]#ps -ax
7275 ? S 0:00 /usr/bin/postmaster -p 5433 -D /var/lib/pgsql/data
7276 ? S 0:00 postgres: stats buffer process
7277 ? S 0:00 postgres: stats collector process
7288 ? S 0:00 /usr/bin/pgpool -n
7289 ? S 0:00 /usr/bin/pgpool -n
7290 ? S 0:00 /usr/bin/pgpool -n
7291 ? S 0:00 /usr/bin/pgpool -n
7292 ? S 0:00 /usr/bin/pgpool -n
7293 ? S 0:00 /usr/bin/pgpool -n
7294 ? S 0:00 /usr/bin/pgpool -n
7295 ? S 0:00 /usr/bin/pgpool -n
orca@woody:~/pgpool-2.0.8$ psql -p 5431 template1
Welcome to psql, the PostgreSQL interactive terminal.
Type: \copyright for distribution terms
\h for help with SQL commands
\? for help on internal slash commands
\g or terminate with semicolon to execute query
\q to quit
template1=> \q
orca@woody:~/pgpool-2.0.8$ psql -p 5432 template1
Welcome to psql, the PostgreSQL interactive terminal.
Type: \copyright for distribution terms
\h for help with SQL commands
\? for help on internal slash commands
\g or terminate with semicolon to execute query
\q to quit
template1=>
-----------------/usr/local/etc/pgpool.conf--------------------#
# pgpool configuration file sample
# $Header: /home/t-ishii/repository/pgpool/pgpool.conf.sample,v 1.7 2004/04/18 0
9:37:46 t-ishii Exp $
# if 1, connection using INET domain socket is allowed
allow_inet_domain_socket = 1
# port number for pgpool
port = 5431
# Unix domain socket path. Debian package default to /var/run/postgresql!
socket_dir = '/var/run/postgresql'
# host name where PostgreSQL server is running on. '' means localhost using UNIX
# domain socket
backend_host_name = 'localhost'
# port number PostgreSQL server is running on.
backend_port = 5432
# Unix domain socket path for the backend. Debian package default to /var/run/po
stgresql!
backend_socket_dir = '/var/run/postgresql' #'/tmp'
# host name where secondary PostgreSQL server is running on. '' means localhost
using UNIX
# domain socket
secondary_backend_host_name = '172.21.x.x' #''
# port number secondary PostgreSQL server is running on.
# 0 means no secondrary PostgreSQL
secondary_backend_port = 5432 #0
# number of pre-forked child process
num_init_children = 32
# numer of connection pool allowed for a child process.
max_pool = 4
# if idle for this seconds, child exits. 0 means no timeout. this
# featue is not implemented yet.
child_life_time = 0
# if idle for this seconds, connection to PostgreSQL closes. 0 means
# no timeout
# if idle for this seconds, connection to PostgreSQL closes. 0 means
# no timeout
connection_life_time = 0
# logging directory
logdir = '/tmp'
# replication mode
replication_mode = true #false
# set this to true if you want to avoid deadlock situation when
# replication enabled.
# there will be noticable performance degration, however.
# a work around is set this to false and insert /*STRICT*/ comment
# in the beginning of the SQL command.
replication_strict = true
# when replication_strict is set to true, there will be a chance for
# deadlocks. set this to non 0 (in milli seconds) to detect this
# situation and resolve the deadlock aborting current session.
replication_timeout = 5000
簡単な対話式のデータはうまく書き込まれるが、高負荷のかかる処理においては
pgpoolが動作しなくなる。
orca@woody:/usr/local/src/postgres/7.2/postgresql-7.2.3/contrib/pgbench$ su - po
stgres
Password:
postgres@woody:~$ cd /usr/local/src/postgres/7.2/postgresql-7.2.3/contrib/pgbenc
h
postgres@woody:/usr/local/src/postgres/7.2/postgresql-7.2.3/contrib/pgbench$ mak
e
gcc -O2 -Wall -Wmissing-prototypes -Wmissing-declarations -I../../src/interfaces
/libpq -I. -I../../src/include -c -o pgbench.o pgbench.c
gcc -O2 -Wall -Wmissing-prototypes -Wmissing-declarations pgbench.o -L../../src/
interfaces/libpq -lpq -Wl,-rpath,/usr/local/src/postgres/7.2/lib -lcrypt -lreso
lv -lnsl -ldl -lm -o pgbench
postgres@woody:/usr/local/src/postgres/7.2/postgresql-7.2.3/contrib/pgbench$ mak
e install
mkdir /usr/local/src/postgres/7.2/doc/contrib
/bin/sh ../../config/install-sh -c -m 644 ./README.pgbench /usr/local/src/postgr
es/7.2/doc/contrib
/bin/sh ../../config/install-sh -c -m 644 ./README.pgbench_jis /usr/local/src/po
stgres/7.2/doc/contrib
/bin/sh ../../config/install-sh -c pgbench /usr/local/src/postgres/7.2/bin
postgres@woody:/usr/local/src/postgres/7.2/postgresql-7.2.3/contrib/pgbench$
postgres@woody:/usr/local/src/postgres/7.2/postgresql-7.2.3/contrib/pgbench$ cre
atedb -p 5433 -E EUC_JP pgbench
CREATE DATABASE
postgres@woody:/usr/local/src/postgres/7.2/postgresql-7.2.3/contrib/pgbench$ pgb
ench -p 5433 -i pgbench
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'branches_pkey' f
or table 'branches'
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'tellers_pkey' fo
r table 'tellers'
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'accounts_pkey' f
or table 'accounts'
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.
vacuum...done.
postgres@woody:/usr/local/src/postgres/7.2/postgresql-7.2.3/contrib/pgbench$ pgbench -p 5433 -c 50 pgbench
starting vacuum...end.
transaction type: TPC-B (sort of)
scaling factor: 1
number of clients: 50
number of transactions per client: 10
number of transactions actually processed: 500/500
tps = 52.639818(including connections establishing)
tps = 54.117029(excluding connections establishing)
|