From: Andrew McMillan <andrew@catalyst.net.nz>
To: Culley Harrelson <Culley_Harrelson@pgn.com>
Cc: cmr@shell.gis.net
Cc: pgsql-php@postgresql.org
Subject: Re: passing resource id's through functions
Date: 15 Jan 2002 13:23:46 +1300
Message-ID: <1011054226.26843.25.camel@kant.mcmillan.net.nz> (raw)
In-Reply-To: <sc42a479.064@pgn.com>
References: <sc42a479.064@pgn.com>
On Tue, 2002-01-15 at 06:27, Culley Harrelson wrote:
> DBBalancer looks interesting. Looks like you are part of the development
> team with this project?
I am packaging it for Debian, and I am using it. All the C++ coding is
being done by Daniel Varela.
> What sort of performance difference to you see?
For most things the performance is roughly equivalent to using
persistent connections. If your resultsets are very large you will see
a performance impact because of the extra layer.
When I first started using it I benchmarked one of the applications I
use and decided it was around 5-10% faster than persistent connections,
but that was with small recordsets.
The main performance advantage for me is that I can have fewer database
connections than apache processes. Each page served on my sites usually
has a mix of database content and static (image) content, and apache
doesn't need to have a database operating for the static stuff, so I
only need around 30% database clients vs apache clients. Persistent
connections would have a 1 for 1 match, after they have been running for
a while. This means less memory pressure on the system, which is the
big win for me.
> When I made the decision to go with php/postgres as my primary
> development technologies I never even started using persistant
> connections because of all the mixed reviews. The database is local
> to the web server and performance is fine. I would be interested in
> hearing more about this connection pooling though...
There are some things you have to watch out for:
- use of temp tables
- transactions that you forgot to commit / rollback
That's the price you pay :-)
The biggest advantage of DBBalancer is probably that it doesn't require
you to make any changes to your PHP, other than in the pg_connect
statement - it's just as if you were connecting to a different database
server, because it supports the PostgreSQL interface natively. Other
connection pooling approaches may want you to load a different module
into PHP, or use a different set of PHP functions. This means that the
layer is very thin, as well.
Cheers,
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?
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-php@postgresql.org
Cc: andrew@catalyst.net.nz, Culley_Harrelson@pgn.com, cmr@shell.gis.net
Subject: Re: passing resource id's through functions
In-Reply-To: <1011054226.26843.25.camel@kant.mcmillan.net.nz>
References: <sc42a479.064@pgn.com> <1011054226.26843.25.camel@kant.mcmillan.net.nz>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox