Ok, I did some benchmark on my Linux box (AMD 1.2Ghz,
256MB, Fedora Core 1 Linux 2.4.20-8) using Pgpool 1.2
and PostgreSQL 7.4. I ran the benchmark script
repeatedly (10+ times each).
I get 5x faster using Pgpool on UNIX socket, which is
encouraging. This shows pre-fork does speed things up
even with the overhead incurred by the proxy.
However, when I tried TCP socket, Pgpool was actually
slower by 15x !! Tatsuo, perhaps you can clarify why
the TCP socket is so much slower?
PHP connecting on UNIX socket
-----------------------------
Without pgpool: 0.144 sec
With pgpool : 0.027 sec
PHP connecting on TCP Socket
----------------------------
Without pgpool: 0.152 sec
With pgpool : 2.39 sec
<?php
$time_start = getmicrotime();
for ($i = 0; $i < 20; $i++) {
// With pgpool on UNIX socket //$DBH = pg_connect('dbname=test1 port=9999
user=postgres');
// With pgpool on TCP socket //$DBH = pg_connect('dbname=test1
host=127.0.0.1 port=9999 user=postgres');
// Without pgpool on UNIX socket //$DBH = pg_connect('dbname=test1
user=postgres');
// Without pgpool on TCP socket //$DBH = pg_connect('dbname=test1
host=127.0.0.1 user=postgres');
$Res = pg_exec($DBH, 'SELECT 1'); pg_close($DBH);
}
$Time = getmicrotime() - $time_start;
?>
I only changed the pgpool configuration where it says:
allow_inet_domain_socket = 1
__________________________________
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs
http://hotjobs.sweepstakes.yahoo.com/careermakeover