Skip site navigation (1) Skip section navigation (2)

Re: Large difference between elapsed time and run time

From: Nikk Anderson <Nikk(dot)Anderson(at)parallel(dot)ltd(dot)uk>
To: "'Jeffrey D(dot) Brower'" <jeff(at)pointhere(dot)net>,pgsql-performance(at)postgresql(dot)org
Subject: Re: Large difference between elapsed time and run time
Date: 2003-03-11 14:30:45
Message-ID: DA1274E682D3734B8802904A9B36124C298CD8@nic-nts1.nic.parallel.ltd.uk (view raw or flat)
Thread:
Lists: pgsql-performance
Hi, 

-----Original Message-----
From: Jeffrey D. Brower [mailto:jeff(at)pointhere(dot)net]
Sent: 11 March 2003 14:24
To: Nikk Anderson; 'Scott Buchan'; pgsql-performance(at)postgresql(dot)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

Responses

pgsql-performance by date

Next:From: Jeffrey D. BrowerDate: 2003-03-11 14:53:45
Subject: Re: Large difference between elapsed time and run time
Previous:From: Jeffrey D. BrowerDate: 2003-03-11 14:24:20
Subject: Re: Large difference between elapsed time and run time

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group