Received: from socrates.catalyst.net.nz (socrates.catalyst.net.nz [203.96.153.226]) by postgresql.org (8.11.3/8.11.4) with ESMTP id g0F0O5V96592 for ; Mon, 14 Jan 2002 19:24:06 -0500 (EST) (envelope-from andrew@catalyst.net.nz) Received: from heidegger.catalyst.net.nz (hume.catalyst.net.nz [203.96.153.228]) by socrates.catalyst.net.nz (8.9.3/8.9.3/Debian 8.9.3-21) with ESMTP id NAA19954; Tue, 15 Jan 2002 13:24:02 +1300 X-Authentication-Warning: socrates.catalyst.net.nz: Host hume.catalyst.net.nz [203.96.153.228] claimed to be heidegger.catalyst.net.nz Received: from 127.0.0.1 (ident=unknown) by heidegger.catalyst.net.nz with esmtp (MasqMail 0.1.16) id 16QHOE-5ka-00; Tue, 15 Jan 2002 13:23:46 +1300 Subject: Re: passing resource id's through functions From: Andrew McMillan To: Culley Harrelson Cc: cmr@shell.gis.net, pgsql-php@postgresql.org In-Reply-To: References: Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Evolution/1.0 (Preview Release) Date: 15 Jan 2002 13:23:46 +1300 Message-Id: <1011054226.26843.25.camel@kant.mcmillan.net.nz> Mime-Version: 1.0 X-Archive-Number: 200201/18 X-Sequence-Number: 825 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?