Re: [GENERAL] Persistent Connections in Webserver Environment

2005-05-02 Thread Hannes Dorbath
On 02.05.2005 18:33, Marco Colombo wrote: #1 Golden Rule for optimizing: - Don't. (Expecially when it causes _real_ troubles elsewhere.) hmm.. :/ I'll do some more meaningful testing on server load this night.. Thanks so far! ---(end of broadcast)---

Re: [GENERAL] Persistent Connections in Webserver Environment

2005-05-02 Thread Marco Colombo
On Mon, 2005-05-02 at 17:32 +0200, Hannes Dorbath wrote: > On 02.05.2005 16:41, Marco Colombo wrote: > > > Have you measured the real gain in using persistent connections at all? > > As simple as possible: > > require_once('Benchmark/Timer.php'); > $timer =& new Benchmark_Timer(); > $timer->sta

Re: [GENERAL] Persistent Connections in Webserver Environment

2005-05-02 Thread Hannes Dorbath
On 02.05.2005 17:41, Scott Marlowe wrote: But if the average PHP script takes 50 milliseconds to start up and 100 milliseconds to run, then either one is still pretty much noise. Yeah, _IF_ :) Our scripts reside precompiled in a bytecode cache so there just isn't much start up time ;) I just repl

Re: [GENERAL] Persistent Connections in Webserver Environment

2005-05-02 Thread Scott Marlowe
On Mon, 2005-05-02 at 10:32, Hannes Dorbath wrote: > On 02.05.2005 16:41, Marco Colombo wrote: > > > Have you measured the real gain in using persistent connections at all? > > As simple as possible: > > require_once('Benchmark/Timer.php'); > $timer =& new Benchmark_Timer(); > $timer->start();

Re: [GENERAL] Persistent Connections in Webserver Environment

2005-05-02 Thread Hannes Dorbath
On 02.05.2005 17:32, Hannes Dorbath wrote: $q = "SELECT u.login FROM users WHERE u.user_id = 1;"; Sorry, it should read: $q = "SELECT u.login FROM users u WHERE u.user_id = 1;"; I accidently removed the "u" after users while removing line breaks to make it shorter to post here. --

Re: [GENERAL] Persistent Connections in Webserver Environment

2005-05-02 Thread Hannes Dorbath
On 02.05.2005 16:41, Marco Colombo wrote: Have you measured the real gain in using persistent connections at all? As simple as possible: start(); pg_pconnect('host=myhost dbname=database user=user'); pg_query("SET search_path TO myschema;"); $q = "SELECT u.login FROM users WHERE u.user_id = 1;"; $q

Re: [GENERAL] Persistent Connections in Webserver Environment

2005-05-02 Thread Hannes Dorbath
On 02.05.2005 16:41, Marco Colombo wrote: Have you measured the real gain in using persistent connections at all? I measured it about one year ago on a linux box. Swichting from multi-user-pg_connect to single-user-pg_pconnect was a big improvment on that box -- 50% and more on pages with just 1-

Re: [GENERAL] Persistent Connections in Webserver Environment

2005-05-02 Thread Marco Colombo
On Mon, 2005-05-02 at 14:45 +0200, Hannes Dorbath wrote: > Hi, > as the subject says I need some advice on setting up connection handling > to PG in a webserver environment. It's a typical dual Xeon FreeBSD box > running Apache2 with mod_php5 and PG 8. About 20 different applications > (ecommerc

Re: [GENERAL] Persistent Connections in Webserver Environment

2005-05-02 Thread Hannes Dorbath
Hm. That would work, but there are so many data-altering queries, it's a lot of work :/ I'm dreaming of a simple proxy that securely holds a pool of su-connections and uses: SET SESSION AUTHORIZATION $foo; $query; RESET SESSION AUTHORIZATION; It would just have to filter queries that contain "S

Re: [GENERAL] Persistent Connections in Webserver Environment

2005-05-02 Thread Sean Davis
I have only a few connections, but I just connect with the equivalent of your "apache" user. My database is pretty much query-only with a few exceptions that are not "sensitive". But for you, could you just write a stored function to do the transaction and write the audit trail for data-alter