pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Roger Ging <roger@musicreports.com>
To: pam@pmg.xs4all.nl
Cc: pgsql-performance@postgresql.org
Subject: Re: How can one see what queries are running withing a
Date: Fri, 25 Jun 2004 12:58:49 -0700
Message-ID: <40DC83F9.3030801@musicreports.com> (raw)
In-Reply-To: <1088192269.6490.3.camel@localhost>
References: <1088192269.6490.3.camel@localhost>



P.A.M. van Dam wrote:

>Hi!
>
>I'd like to know if there is a way to see what queries are running
>within a certain postgres instance and how much resources (cpu/memory)
>etc. they are using. Right now it's impossible to see what is happening
>within postgres when it's binaries are using 100% CPU.
>
>In Sybase there is a command which let's you view what 'processes' are
>running within the server and how much cpu (according to Sybase) they
>are using. It also provides you with a stored procedure to kill off some
>bad behaving queries. How can one do this within postgres?
>
>Thanks in advance!
>
>Best regards,
>
>	Pascal
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 4: Don't 'kill -9' the postmaster
>  
>
select * from pg_stat_activity.  If you want to see the command that was 
run, you will need to turn on stats_command_string = true in 
postgresql.conf and re-start server.  PID shows up, so you can kill bad 
queries from terminal and see CUP % in top

Roger Ging
V.P., Information Technology
Music Reports, Inc.




view thread (7+ messages)  latest in thread

Message-ID: <40DC83F9.3030801@musicreports.com>
Permalink:  ../40DC83F9.3030801@musicreports.com/
Also on:    postgresql.org/message-id/40DC83F9.3030801@musicreports.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: roger@musicreports.com, pam@pmg.xs4all.nl
  Subject: Re: How can one see what queries are running withing a
  In-Reply-To: <40DC83F9.3030801@musicreports.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox