Re: pg_pconnect - ??

From: Andrew McMillan <andrew(at)catalyst(dot)net(dot)nz>
To: Frank Bax <fbax(at)sympatico(dot)ca>
Cc: Chris Ruprecht <chrup999(at)yahoo(dot)com>, PostGreSQL PHP Group <pgsql-php(at)postgresql(dot)org>
Subject: Re: pg_pconnect - ??
Date: 2002-01-31 09:47:51
Message-ID: 1012470472.4254.81.camel@kant.mcmillan.net.nz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php

On Tue, 2002-01-29 at 08:19, Frank Bax wrote:
>
> If your postgres database is on the same server as you webserver, there is
> neglible gains for using pconnect over connect.

I see much larger improvements than that, in the real world, with my
applications which are all running database and webserver on the same
system.

In my applications I use a wrapper for the query process which logs the
query time (amongst other things), and pg_pconnect gives substantial
improvements in regular query performance over pg_connect.

I believe what is happening is that the PostgreSQL client is in some
part caching query plans, metadata and data so that queries execute
faster. For minimal queries the performance gain seems to be as much as
10 times (i.e. the pconnect query frequently runs in 1/10th of the time
of the normal connect).

Obviously these speed improvements also depend on your application's
patterns of data access, but I have not found an application that
doesn't show significant improvement.

I have also found the same order of improvement to be made by using
DBBalancer to pool the database connections.

Regards,
Andrew.
--
--------------------------------------------------------------------
Andrew @ Catalyst .Net.NZ Ltd, PO Box 11-053, Manners St, Wellington
WEB: http://catalyst.net.nz/ PHYS: Level 2, 150-154 Willis St
DDI: +64(4)916-7201 MOB: +64(21)635-694 OFFICE: +64(4)499-2267
Are you enrolled at http://schoolreunions.co.nz/ yet?

In response to

Responses

Browse pgsql-php by date

  From Date Subject
Next Message arun kv 2002-01-31 11:44:14 keyword search help
Previous Message servis 2002-01-31 04:53:00 Arama.com da En Cok Aranan Kelimeler