pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jim C. Nasby <jnasby@pervasive.com>
To: jing han <jing_han_66@yahoo.com>
Cc: pgsql-general@postgresql.org
Subject: Re: [INTERFACES] how to monitor dead connections to postgresql database
Date: Tue, 4 Oct 2005 12:36:28 -0500
Message-ID: <20051004173628.GQ40138@pervasive.com> (raw)
In-Reply-To: <20051004132151.11144.qmail@web53513.mail.yahoo.com>
References: <20051004132151.11144.qmail@web53513.mail.yahoo.com>

On Tue, Oct 04, 2005 at 06:21:51AM -0700, jing han wrote:
> Hello,
> 
> After 6 days busy running, one of my process dead of
> cannot connect to database, and the log message shows
> that exceeding max_connections. The max_connections =
> 30.
> 
> By running watch -d "ps ax |grep postgres" I only find
> 6 connections to database, there must be dead
> connections laying around and I cannot see them.
> 
> Can you tell me how to monitor dead connections to
> postgres database?

This isn't the list for this type of question; moving to -general.

You can query from pg_stat_activity:

SELECT * FROM pg_stat_activity;
or
SELECT count(*) FROM pg_stat_activity;
-- 
Jim C. Nasby, Sr. Engineering Consultant      jnasby@pervasive.com
Pervasive Software      http://pervasive.com    work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461



view thread (2+ messages)

Message-ID: <20051004173628.GQ40138@pervasive.com>
Permalink:  ../20051004173628.GQ40138@pervasive.com/
Also on:    postgresql.org/message-id/20051004173628.GQ40138@pervasive.com

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: jnasby@pervasive.com, jing_han_66@yahoo.com, pgsql-general@postgresql.org
  Subject: Re: [INTERFACES] how to monitor dead connections to postgresql database
  In-Reply-To: <20051004173628.GQ40138@pervasive.com>

* 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