X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 2FFF2D9C47 for ; Thu, 29 Sep 2005 17:02:06 -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 36927-02 for ; Thu, 29 Sep 2005 20:02:02 +0000 (GMT) Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.205]) by svr1.postgresql.org (Postfix) with ESMTP id 1848AD9C43 for ; Thu, 29 Sep 2005 17:02:01 -0300 (ADT) Received: by zproxy.gmail.com with SMTP id 40so176527nzk for ; Thu, 29 Sep 2005 13:02:03 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=oqjiQl6wTw1l9vtgc3SbejEovKbYzayEKNZMcUKpk+MG8YlCxob0q8+kOTiWP/yCiYD3sAMvuXPTPbzsDV3GmxNBLeL2wLl4G0zQ2sjdhoPgzqeEthlSBRwTAxSacJtHwI8GPVB2YzdCg2GhQbte6Vl9Mn4hfdLOY3A+E3qwESM= Received: by 10.37.22.45 with SMTP id z45mr2792844nzi; Thu, 29 Sep 2005 13:02:03 -0700 (PDT) Received: by 10.37.14.69 with HTTP; Thu, 29 Sep 2005 13:02:03 -0700 (PDT) Message-ID: <6d8daee3050929130275807ff2@mail.gmail.com> Date: Thu, 29 Sep 2005 13:02:03 -0700 From: Tony Wasson Reply-To: Tony Wasson To: pgsql-performance@postgresql.org Subject: Re: Monitoring Postgresql performance Cc: arnaulist@andromeiberica.com, newz@bearfruit.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <433AA962.9020900@andromeiberica.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.116 required=5 tests=[AWL=0.092, RCVD_BY_IP=0.024] X-Spam-Level: X-Archive-Number: 200509/431 X-Sequence-Number: 14739 On 9/28/05, Matthew Nuzum wrote: > On 9/28/05, Arnau wrote: > > Hi all, > > > > I have been "googling" a bit searching info about a way to monitor > > postgresql (CPU & Memory, num processes, ... ) and I haven't found > > anything relevant. I'm using munin to monitor others parameters of my > > servers and I'd like to include postgresql or have a similar tool. Any > > of you is using anything like that? all kind of hints are welcome :-) We are also using cricket + nagios. On each DB server: Setup snmpd and use snmpd.conf to set disk quotas and mark processes that need to be running (like postmaster,syslog,sshd) On the monitoring server(s): Use cricket for long term trends & graphs. Use nagios for current status and alerting and some trending. (Nagios has plugins over SNMP for load,cpu,memory,disk and processes) Here's the nagios plugins I have hacked up over the past few months and what they do. I'd imagine some could use better names. I can provide these of package them up if anyone is interested. check_pgconn.pl - Shows percentage of connections available. It uses "SELECT COUNT(*) FROM pg_stat_activity" / "SHOW max_connections". It can also alert when less than a certain number of connections are available. check_pgqueries.pl - If you have query logging enabled this summarizes the types of queries running (SELECT ,INSERT ,DELETE ,UPDATE ,ALTER ,CREATE ,TRUNCATE, VACUUM, COPY) and warns if any queries have been running longer than 5 minutes (configurable). check_pglocks.pl - Look for locks that block and for baselining lock activi= ty. check_pgtime.pl - Makes sure that postgresql's time is in sync with the monitoring server. check_pgqueries.pl - Whines if any queries are in the "waiting" state. The script that runs on each DB server does "ps auxww | grep postgres | grep -i "[W]aiting"" and exposes that through SNMP using the exec functionality. Nagios then alerts if queries are being blocked.