From: Jeffrey D. Brower <jeff@pointhere.net>
To: Nikk Anderson <Nikk.Anderson@parallel.ltd.uk>
To: pgsql-performance@postgresql.org
Subject: Re: Large difference between elapsed time and run time
Date: Tue, 11 Mar 2003 09:53:45 -0500
Message-ID: <011d01c2e7de$0451c960$0b02a8c0@pointhere.net> (raw)
References: <DA1274E682D3734B8802904A9B36124C298CD8@nic-nts1.nic.parallel.ltd.uk>
RE: [PERFORM] Large difference between elapsed time and run timeYes, this helps a lot. Obviously this is far more complicated than just a simple pg_pconnect to accomplish a speedy reply. I really thought that a persistent connection was supposed to eliminate the overhead time in a connection (well, other than the first time through). But even if I am the only person on the machine it still takes forever to get a response every time I use http. I wondered if I was supposed to have a php program that had its own pconnect and every http call to the PostgreSQL database went to that php program rather than handling it by itself, but I found no indication of that while RTFM. I will give this a try and see if I can get the speed to anything reasonable. Thanks for the quick reply!
Jeff
----- Original Message -----
From: Nikk Anderson
To: 'Jeffrey D. Brower' ; pgsql-performance@postgresql.org
Sent: Tuesday, March 11, 2003 9:30 AM
Subject: Re: [PERFORM] Large difference between elapsed time and run time
Hi,
-----Original Message-----
From: Jeffrey D. Brower [mailto:jeff@pointhere.net]
Sent: 11 March 2003 14:24
To: Nikk Anderson; 'Scott Buchan'; pgsql-performance@postgresql.org
Subject: Re: [PERFORM] Large difference between elapsed time and run time
>My question is how are you accomplishing the connection pooling?
I have programmed a connection pool in Java - I am sure something similar is possible in most other languages.
Very basically, the concept is as follows:
> Application initialisation
>>> 1) Create X number of connections to the database
>>> 2) Store connections in an Object
>>> 3) Create an array of free and busy connections - put all new connections in free connection array
>>> 4) Object is visible to all components of web application
> Request for a connection
>>> 4) Code asks for a connection from the pool object (3).
>>> 5) Pool object moves connection from free array, to the busy array.
>>> 5) Connection is used to do queries
>>> 6) Connection is sent back to pool object (3).
>>> 7) Pool object moves the connection from the busy array, back to the free array
I hope that helps!
Nikk
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-performance@postgresql.org
Cc: jeff@pointhere.net, Nikk.Anderson@parallel.ltd.uk
Subject: Re: Large difference between elapsed time and run time
In-Reply-To: <011d01c2e7de$0451c960$0b02a8c0@pointhere.net>
References: <DA1274E682D3734B8802904A9B36124C298CD8@nic-nts1.nic.parallel.ltd.uk> <011d01c2e7de$0451c960$0b02a8c0@pointhere.net>
* 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