Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql General > DB Connections ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 15523 of 17437
Post > Topic >>

DB Connections in TIME_WAIT state

by gateley@[EMAIL PROTECTED] (John Gateley) May 13, 2008 at 08:22 AM

Hi, I'm using the Pg perl module to connect to Postgresql 8.1
via localhost (127.0.0.1) from webscripts. I'm noticing a lot
of TIME_WAIT socket connections:

tcp        0      0 127.0.0.1:39291         127.0.0.1:5432         
TIME_WAIT  
tcp        0      0 127.0.0.1:60720         127.0.0.1:5432         
TIME_WAIT  
tcp        0      0 127.0.0.1:60735         127.0.0.1:5432         
TIME_WAIT  
tcp        0      0 127.0.0.1:60769         127.0.0.1:5432         
TIME_WAIT  
tcp        0      0 127.0.0.1:39281         127.0.0.1:5432         
TIME_WAIT  
....

I think the number is high enough (200~250) that sometime the
server runs out of sockets.

What's the proper way to close the postgresql connection so that
it doesn't go into a TIME_WAIT state?

I tried:

use Pg;
my $Connection = Pg::connectdb($ConnectString);
.... do some stuff
$Connection = 0;

That doesn't seem to close the connection.

Any ideas?

Thanks,

j
-- 
John Gateley <gateley@[EMAIL PROTECTED]
>

-- 
Sent via pgsql-general mailing list (pgsql-general@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
 




 2 Posts in Topic:
DB Connections in TIME_WAIT state
gateley@[EMAIL PROTECTED]  2008-05-13 08:22:15 
Re: DB Connections in TIME_WAIT state
tgl@[EMAIL PROTECTED] (T  2008-05-13 10:23:48 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Nov 22 12:40:16 CST 2008.