Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dBChM-00022Q-UV for pgsql-general@arkaria.postgresql.org; Thu, 18 May 2017 04:06:01 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dBChM-00005j-FM for pgsql-general@arkaria.postgresql.org; Thu, 18 May 2017 04:06:00 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dBCex-00043Z-Rn for pgsql-general@postgresql.org; Thu, 18 May 2017 04:03:31 +0000 Received: from hogranch.com ([75.101.82.47]) by magus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dBCep-0002yi-RF for pgsql-general@postgresql.org; Thu, 18 May 2017 04:03:31 +0000 Received: from [192.168.0.2] (porker [192.168.0.2]) by hogranch.com (8.11.6/8.11.6) with ESMTP id v4I43Gp23851 for ; Wed, 17 May 2017 21:03:16 -0700 Subject: Re: PostgrSQL server : CPU and Memory To: pgsql-general@postgresql.org References: From: John R Pierce Message-ID: <8cc6480c-199e-c37a-736b-4aece76630ec@hogranch.com> Date: Wed, 17 May 2017 21:03:10 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-HawgScanner-Information: Please contact the ISP for more information X-HawgScanner: Found to be clean X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-general Precedence: bulk Sender: pgsql-general-owner@postgresql.org On 5/17/2017 8:50 PM, kaustubh kelkar wrote: > I am a developer and I want to monitor metrics related to CPU and > Memory of PostgreSQL server only using SQL queries. postgres itself doesn't track that level of OS specific stuff. > > Do we have any system tables which can give us the data? I have found > this one > https://aaronparecki.com/2015/02/19/8/monitoring-cpu-memory-usage-from-postgres > > but dont know whether it is exactly the same what I need. thats reading the /proc/.... stuff available on Linux systems via SQL, its the same stuff OS level tools like ps, top, free use... it won't work on non-Linux systems, even other Unix systems like BSD don't have the same /proc stuff, and other OS's like Windows don't have /proc at all. if you don't know whether that's what you need, I'm not sure how we could know what you need. -- john r pierce, recycling bits in santa cruz -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general