Re: PostgreSQL pre-fork speedup

From: sdv mailer <sdvmailer(at)yahoo(dot)com>
To: sdv mailer <sdvmailer(at)yahoo(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: PostgreSQL pre-fork speedup
Date: 2004-05-06 15:13:45
Message-ID: 20040506151345.14614.qmail@web60208.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Adrian Phillips 2004-05-06 15:21:18 Re: PostgreSQL pre-fork speedup
Previous Message sdv mailer 2004-05-06 15:11:36 Re: PostgreSQL pre-fork speedup