Re: Monitoring Connections

Поиск
Список
Период
Сортировка
От Tomeh, Husam
Тема Re: Monitoring Connections
Дата
Msg-id CB0FB369FF86E248A884BCC002562BCB0227DA1E@pisgsna01sxch01.ana.firstamdata.com
обсуждение исходный текст
Ответ на Monitoring Connections  ("Aaron Bono" <postgresql@aranya.com>)
Ответы Re: Monitoring Connections  ("Tomeh, Husam" <htomeh@firstam.com>)
Список pgsql-admin
Query the pg_stat_activity.
For more detailed stats activities, you may query the pg_stat_* and pg_statio_*  system views.
 
 
--
  Husam
 


From: pgsql-admin-owner@postgresql.org [mailto:pgsql-admin-owner@postgresql.org] On Behalf Of Aaron Bono
Sent: Wednesday, September 20, 2006 10:48 AM
To: pgsql admin
Subject: [ADMIN] Monitoring Connections

Is there a way to get diagnostics on current connections to the database?  Specifically I am looking for:

1. How many current connections are there?
2. Who is connected (user name, database and from what IP address)?
3. When was the last time the connection was used?
4. When was the connection established?

I can get most of this information from the ps command but am having problem with getting the information on #3.

My problem is that I have a number of web sites running on the server all using different databases and/or user log ins and also using connection pooling.  Whenever I redeploy an application, the "old" connections do not appear to disconnect but new connections are established.  I fear that, since the application server is not actually restarting but just reloading the application, it is keeping old connections open when they really should be closed.  This is something I will need to fix in the application but I need to do some digging before I know this is indeed the problem.

I am using PostgreSQL 8.1.3 on CentOS.

Thanks!

--
==================================================================
   Aaron Bono
   Aranya Software Technologies, Inc.
   http://www.aranya.com
   http://codeelixir.com
==================================================================

**********************************************************************
This message contains confidential information intended only for the use of the addressee(s) named above and may contain information that is legally privileged.  If you are not the addressee, or the person responsible for delivering it to the addressee, you are hereby notified that reading, disseminating, distributing or copying this message is strictly prohibited.  If you have received this message by mistake, please immediately notify us by replying to the message and delete the original message immediately thereafter.

Thank you.

                                                                                                                         FADLD Tag
**********************************************************************

В списке pgsql-admin по дате отправления:

Предыдущее
От: "Aaron Bono"
Дата:
Сообщение: Monitoring Connections
Следующее
От: "Tomeh, Husam"
Дата:
Сообщение: Re: Monitoring Connections