Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id AE167B5DBC1 for ; Wed, 28 Sep 2011 04:10:53 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 58094-10 for ; Wed, 28 Sep 2011 07:10:46 +0000 (UTC) X-Greylist: delayed 00:05:04.267038 by SQLgrey-1.8.0-rc2 Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.17.8]) by mail.postgresql.org (Postfix) with ESMTP id 7B5EDB5D8C5 for ; Wed, 28 Sep 2011 04:10:46 -0300 (ADT) Received: from [75.247.200.113] (113.sub-75-247-200.myvzw.com [75.247.200.113]) by mrelayeu.kundenserver.de (node=mreu1) with ESMTP (Nemesis) id 0LzWb8-1R3hdS1k5C-0149pU; Wed, 28 Sep 2011 09:05:37 +0200 Message-ID: <4E82C73A.1050700@2ndquadrant.com> Date: Wed, 28 Sep 2011 00:05:30 -0700 From: Greg Smith User-Agent: Thunderbird 2.0.0.24 (X11/20100317) MIME-Version: 1.0 To: Venkat Balaji CC: PGSQL Performance Subject: Re: PostgreSQL-9.0 Monitoring System to improve performance References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:1erJSnwHOAKkt6QSk28Pvxt0ex9No/4amWRATdGIi1B O/9nz29Vw9VRu//NpVrYjFA3xP+J+1l20xvI+yA9pWIhezwC/p 7em/m2fHnuCv9Hs7fCKHjQKhC4lcey7NZc0s4bBjQ73z13K+Xm sMjKnhcDtGaYb4sh5hNFp+23HIX3jJdL2+Mh5oigKtgwoXzO4P 3B8OT/4O67GNnYYKSP7U/aQhAvSxkYLv3KdjNmit2VUUujfQki tnblIUflz43YAtHg2DhiNRcXwalPHq0eYoXYS53ND9gbmfVA1o DHEClGN7sOuNoe1Lw/Eawhnnrw/I4v4hlUxRfpkz5rI93lEjwn blT4lGI+dPwk+YHgbUFTO5LHstHypklvtJF57uDDz X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201109/409 X-Sequence-Number: 45185 Venkat Balaji wrote: > > 1. Big Full Table Scans > 2. Table with high IOs (hot tables) > 3. Highly used Indexes > 4. Tables undergoing high DMLs with index scans 0 (with unused indexes) > 5. Index usage for heap blk hits > 6. Tracking Checkpoints This is fairly easy to collect and analyze. You might take a look at pgstatspack to see how one program collects snapshots of this sort of information: http://pgfoundry.org/projects/pgstatspack/ > > 8. Buffer cache usage High-level information about this can be collected by things like the pg_statio* views. If you want to actually look inside the buffer cache and get detailed statistics on it, that's a harder problem. I have some sample queries for that sort of thing in my book. > 9. Tables, Indexes and Database growth statistics This is valuable information to monitor over time, but I'm not aware of any existing tools that track it well. It won't be hard to collect it on your own though. > 7. Tracking CPU, IO and memory usage ( by PG processes ) -- > desperately needed I'm not aware of any open-source tool that tracks this information yet. PostgreSQL has no idea what CPU, memory, and I/O is being done by the OS when you execute a query. The operating system knows some of that, but has no idea what the database is doing. You can see a real-time snapshot combining the two pieces of info using the pg_top program: http://ptop.projects.postgresql.org/ but I suspect what you want is a historical record of it instead. Writing something that tracks both at once and logs all the information for later analysis is one of the big missing pieces in PostgreSQL management. I have some ideas for how to build such a thing. But I expect it will take a few months of development time to get right, and I haven't come across someone yet who wants to fund that size of project for this purpose yet. -- Greg Smith 2ndQuadrant US greg@2ndQuadrant.com Baltimore, MD PostgreSQL Training, Services, and 24x7 Support www.2ndQuadrant.us