X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 89B27DA039 for ; Tue, 4 Oct 2005 14:36:31 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 76303-10 for ; Tue, 4 Oct 2005 17:36:29 +0000 (GMT) Received: from flake.decibel.org (flake.decibel.org [67.100.216.10]) by svr1.postgresql.org (Postfix) with ESMTP id B2FC7D7AAB for ; Tue, 4 Oct 2005 14:36:28 -0300 (ADT) Received: by flake.decibel.org (Postfix, from userid 1001) id 36BDB1524F; Tue, 4 Oct 2005 12:36:29 -0500 (CDT) Date: Tue, 4 Oct 2005 12:36:28 -0500 From: "Jim C. Nasby" To: jing han Cc: pgsql-general@postgresql.org Subject: Re: [INTERFACES] how to monitor dead connections to postgresql database Message-ID: <20051004173628.GQ40138@pervasive.com> References: <20051004132151.11144.qmail@web53513.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20051004132151.11144.qmail@web53513.mail.yahoo.com> X-Operating-System: FreeBSD 4.11-RELEASE-p10 i386 X-Distributed: Join the Effort! http://www.distributed.net User-Agent: Mutt/1.5.9i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.005 required=5 tests=[AWL=0.005] X-Spam-Level: X-Archive-Number: 200510/110 X-Sequence-Number: 84339 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