473,503 Members | 1,662 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

removing idle connections

Is there a way to remove idle connections? My postgres server is
getting serveral hundred idle connections. It's due to a postgres .NET
provider not closing the connections properly. I don't want to kill
them all, or restart postgres everytime the connections go crazy.

-Josh

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 23 '05 #1
4 12821
On 19 Oct 2004 at 13:00, Josh Close wrote:
Is there a way to remove idle connections? My postgres server is
getting serveral hundred idle connections. It's due to a postgres .NET
provider not closing the connections properly. I don't want to kill
them all, or restart postgres everytime the connections go crazy.


I would have though it would be better to fix the client application. If the
app is not closing connections then you may be leaking handles and
memory.

What .NET provider is this? Are you sure it is not just normal
connection pooling?

Cheers,
Gary.
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 23 '05 #2
On Tue, 19 Oct 2004 19:24:23 +0100, Gary Doades <gp*@gpdnet.co.uk> wrote:
I would have though it would be better to fix the client application. If the
app is not closing connections then you may be leaking handles and
memory.

What .NET provider is this? Are you sure it is not just normal
connection pooling?

Cheers,
Gary.


The provider is corelabs. The programmer that wrote the code says he's
closing the connections, but they aren't actually closing.

Any ideas? Or better yet, do you know of a good postgres .net provider?

-Josh

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Nov 23 '05 #3
On 19 Oct 2004 at 13:32, Josh Close wrote:
The provider is corelabs. The programmer that wrote the code says he's
closing the connections, but they aren't actually closing.

Any ideas? Or better yet, do you know of a good postgres .net provider?


Hmm, I've had lots of problems with the Corelabs provider. The open
source provider (Npgsql) available on GBorg is a lot better for most
things.

I reverted to using the ODBC driver for Postgres with the .NET Odbc
provider. Works fine.

With connection pooling enabled you will see several "idle" connections
around waiting to be re-used by a provider connection supplying the
same credentials and options as a "disconnected" pooled-but-idle
connection. If you connect with a different username/password
everytime then this may be a problem, otherwise it is a big performance
gain in the disconnected recordset world of .NET.

Cheers,
Gary.

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 23 '05 #4
Josh Close wrote:
Is there a way to remove idle connections? My postgres server is
getting serveral hundred idle connections. It's due to a postgres .NET
provider not closing the connections properly. I don't want to kill
them all, or restart postgres everytime the connections go crazy.


I do not think is problem of not close the connections.
I bet the driver is acting like this:
On connection:
. Connect
. start transaction

On Commit:
. commit transaction
. start transaction

On Abort:
. abort transaction
. start transaction

On statemet:
. execute statement
As you can see you are always inside a transaction, idle I mean.
BTW this is the behaviour of python driver PgDB ( I suggest to
use psycopg instead ) and before the 8.0 series the JDBC driver
did the same. The way to solve it is, delay the begin till the first
statement:
On connection:
. Connect

On Commit:
. commit transaction

On Abort:
. abort transaction

On statemet:
. If is the first statement after a connection or a commit or
an abort execute the: start transaction
. execute statement

For rpm mantainer: why do not include the psycopg instead of the actual
python driver ?
Regards
Gaetano Mendola


Nov 23 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2324
by: Philippe Lang | last post by:
Hello, After using Postgresql for a while, through ODBC / MS Access, I'm not able to connect to the server anymore. The server reports "Too many clients connected already". With a "ps -afx",...
1
5956
by: John Gibson | last post by:
Hi, all. We are running PostgreSQL 7.2.2 (7.4.1 in a few weeks). We have a pesky legacy application which periodically leaves open idle connections. (I know... fix the application). In the...
0
1432
by: Stefan Felkel | last post by:
hi! i have searched a lot in these pgsql-groups and on the internet, but found no really helpful information for my problem. the famous error >> database "xyz" is being accessed by other...
3
5278
by: Praveen_db2 | last post by:
Hi Gurus I came across a small doubt. Suppose I have Max Connections parameter set to 200. There are now 200 connections to the database. Out of these 200 connections 50 are idle. What will...
1
8161
by: Praveen_db2 | last post by:
Hi All I came across a small doubt. Suppose I have Max Connections parameter set to 200. There are now 200 connections to the database. Out of these 200 connections 50 are idle. What will happen...
4
6051
by: elyob | last post by:
Not really tried going two ways at once, but I have an include_once connection to a mysql_database, now I need to retrieve info from a second mysql_database .. My mysql_connects are getting...
4
2221
by: Troels Arvin | last post by:
Hello, Some of our SAS users seem to initiate 20+ idle connections to DB2 every time they start SAS. I'm inclined to tell them to cut down on their DB2 connection number, but then again, if the...
2
4799
by: dantz | last post by:
Having a multiple client/server using a C# httplistener/httpwebrequest to transfer message. How should I handle idle connections? Will it be the job of the server or client? Does using a ping...
2
5347
by: Nebu Pulickal | last post by:
I am having a postgresql database server and the idle connections are not closing themselves. They are increasing to large numbers as time passes and the web page is not loading. The code developer...
0
7083
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7328
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7456
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5578
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5011
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3166
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1510
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
734
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.