X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 8781154993 for ; Wed, 4 May 2005 11:35:33 -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 67890-04 for ; Wed, 4 May 2005 14:35:30 +0000 (GMT) Received: from sccrmhc12.comcast.net (sccrmhc12.comcast.net [204.127.202.56]) by svr1.postgresql.org (Postfix) with ESMTP id EE03153CD6 for ; Wed, 4 May 2005 11:35:28 -0300 (ADT) Received: from jefftrout.com ([24.61.201.181]) by comcast.net (sccrmhc12) with SMTP id <2005050414353101200dh940e>; Wed, 4 May 2005 14:35:32 +0000 Received: (qmail 58975 invoked from network); 4 May 2005 14:30:57 -0000 Received: from waltham-nat.ma.lycos.com (HELO ?10.124.7.97?) (209.202.205.1) by 192.168.0.109 with SMTP; 4 May 2005 14:30:57 -0000 In-Reply-To: <4276A534.7060607@logix-tt.com> References: <42740256.4090200@streppone.it> <4276A534.7060607@logix-tt.com> Mime-Version: 1.0 (Apple Message framework v728) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <8721B090-C082-4860-88F3-CBD60EE4D4D0@torgo.978.org> Cc: Cosimo Streppone , pgsql-announce@postgresql.org, pgsql-sql@postgresql.org Content-Transfer-Encoding: 7bit From: Jeff - Subject: Re: [ANNOUNCE] pgtop, display PostgreSQL processes in `top' style Date: Wed, 4 May 2005 10:28:19 -0400 To: Markus Schaber X-Mailer: Apple Mail (2.728) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.18 tagged_above=0 required=5 tests=AWL, RCVD_BY_IP, RCVD_IN_SORBS_DUL X-Spam-Level: X-Archive-Number: 200505/39 X-Sequence-Number: 21352 On May 2, 2005, at 6:09 PM, Markus Schaber wrote: > >> 1) is it possible to know Pg backend uptime with >> SQL queries? Or must I look at postmaster.pid file? >> or even something else? >> > > In contrib, there's a function caled backend_pid() defined in > misc_utils.sql, it may be helpful for you. > > markus > I wrote a small util called "pgtop" that does a top style listing on PG in terms of cpu. I also have one called pgiomonitor (that is on pgfoundry and mostly done) that does the same but shows you which tables are producing the most IO) http://postgresql.jefftrout.com/pgtop.pl it only runs on linux and it must run on the same box as pg itself. You may want to look at it and see if you can get anything good out of it. queries / second is tricky. You could look at my pgspy utility but it is in C. It can give you queries / second data -- Jeff Trout http://www.jefftrout.com/ http://www.stuarthamm.net/