Re: adding more information about process(es) cpu and memory usage

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: hlinnaka(at)iki(dot)fi
Cc: Radovan Jablonovsky <radovan(dot)jablonovsky(at)replicon(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: adding more information about process(es) cpu and memory usage
Date: 2015-04-24 01:22:14
Message-ID: CAMkU=1xGF_TrT1pmzkJMDPZgU5ryuvEc93C6AkZbzzKSXer7TA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Apr 23, 2015 at 10:17 AM, Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
wrote:

> On 04/23/2015 08:00 PM, Radovan Jablonovsky wrote:
>
>> During current encounters with amazon web services - RDS, the DBA does not
>> have access to OS/linux shell of underlying instance. That render some
>> postgresql monitoring technique of process CPU and memory usage, not
>> useful. Even if the AWS provide internal tools/programming interface for
>> monitoring, it could be very useful to have this information provided by
>> postgresql system table(s)/view/functions/api. The information about how
>> much postgresql background/process is using CPU (similar to command top
>> result) and memory. it could be something as simple as adding cpu,memory
>> information fields to pg_stat_activity.
>>
>
> You can write an extension to do that. Of course, Amazon won't let you run
> your own C extension either (otherwise you could use that to escape into
> shell), but if you do it well and publish and get it included into standard
> distributions, they just might pick it up. Unless they don't want you to
> see that information. If they don't, then they wouldn't let you use the
> system views either.
>
> In a nutshell, I don't think PostgreSQL should get involved in that...
>
>
I have often wanted an SQL function which would expose the back-end's
rusage statistics to the front-end. This could support a \timing feature
variant to psql that reports more than just wall-clock time.

I don't use RDS, and use shell access and "top" (and "strace" and "gdb")
quite enthusiastically, but still it is a pain to correlate any given
front-end to any given back-end.

Would such an addition to core be welcome?

Cheers,

Jeff

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2015-04-24 01:28:52 Re: adding more information about process(es) cpu and memory usage
Previous Message Christian Ullrich 2015-04-24 01:12:02 Re: [committers] pgsql: RLS fixes, new hooks, and new test module