I queried pg_stat_activity a bunch of times and was able to tell what tables
were being queried. I finally honed in on the section of code causing the
problem and fix it and all is good on the server now - over 90% idle.
I think the reason some of the processes were showing high CPU usage was
th
The following query with the stats_command_string parameter turned on will
give you some of the SQL per transaction:-
SELECT
datid,
datname as "DB Name",
substr(procpid,1,6) as "Procpid",
substr(usesysid,1,5) as "UseSysid",
usename,
current_query as "SQL",
query_start
FROM
pg_stat_activity
order
cerely,
--
Husam
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of
Aaron Bono
Sent: Wednesday, November 22, 2006 1:14 PM
To: Tomeh, Husam
Cc: pgsql-admin@postgresql.org
Subject: Re: [ADMIN] Monitoring PostgreSQL Process
On 11/22/06, Tomeh, Husam <[EMAIL PROTECTED]> wrote:
D] On Behalf Of
Aaron Bono
Sent: Wednesday, November 22, 2006 1:46 PM
To: Tomeh, Husam
Cc: pgsql-admin@postgresql.org
Subject: Re: [ADMIN] Monitoring PostgreSQL Process
On 11/22/06, Tomeh, Husam <[EMAIL PROTECTED]> wrote:
This indicates that some stats parameters are not enabled in
h, Husam
*Cc:* pgsql-admin@postgresql.org
*Subject:* Re: [ADMIN] Monitoring PostgreSQL Process
On 11/22/06, Tomeh, Husam <[EMAIL PROTECTED]> wrote:
>
> You may query the system view, pg_stat_activity to check out the
> current SQL statements running. To track down executed SQL state
I check these tables.
--
*From:* [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] *On Behalf Of *Aaron
Bono
*Sent:* Wednesday, November 22, 2006 1:46 PM
*To:* Tomeh, Husam
*Cc:* pgsql-admin@postgresql.org
*Subject:* Re: [ADMIN] Monitoring PostgreSQL Process
On 11/22/06, Tomeh, Husam <
are running the longest and most frequently.
--
Husam
http://firstdba.googlepages.com
--
*From:* [EMAIL PROTECTED] [mailto:
[EMAIL PROTECTED] *On Behalf Of *Aaron Bono
*Sent:* Tuesday, November 21, 2006 9:50 PM
*To:* pgsql-admin@postgresql.org
*Subject:* [ADMIN] Monit
ovember 21, 2006 9:50 PM
To: pgsql-admin@postgresql.org
Subject: [ADMIN] Monitoring PostgreSQL Process
I have a couple processes/connections to one of our databases that
appears to be eating up most of the CPU and we are trying to determine
what these processes are doing that is taking so much CPU
I have a couple processes/connections to one of our databases that appears
to be eating up most of the CPU and we are trying to determine what these
processes are doing that is taking so much CPU time.
Is there a way to monitor the SQL being run for a specific
connection/process?
We are using Po