Re: PostgreSQL pre-fork speedup

From: sdv mailer <sdvmailer(at)yahoo(dot)com>
To: Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp>, pg(at)rbt(dot)ca
Cc: scott(dot)marlowe(at)ihs(dot)com, steve(at)blighty(dot)com, pgsql-hackers(at)postgresql(dot)org
Subject: Re: PostgreSQL pre-fork speedup
Date: 2004-05-06 15:11:36
Message-ID: 20040506151136.23493.qmail@web60206.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tatsuo,

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.

However, when I tried TCP socket, Pgpool was actually
slower by 15x !! 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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message sdv mailer 2004-05-06 15:13:45 Re: PostgreSQL pre-fork speedup
Previous Message Shachar Shemesh 2004-05-06 14:59:24 Re: Multiple "selects" returned from a single stored procedure