pg.ddx.io pgsql-performance@postgresql.org mailing list archive
help / color / mirror / Atom feedHow can one see what queries are running withing a postgres instance?
7+ messages / 6 participants
[nested] [flat]
* How can one see what queries are running withing a postgres instance?
@ 2004-06-25 19:37 P.A.M. van Dam <pam@pmg.xs4all.nl>
2004-06-25 19:58 ` Re: How can one see what queries are running withing a Roger Ging <roger@musicreports.com>
2004-06-25 20:51 ` Re: How can one see what queries are running withing a postgres instance? Hervé Piedvache <footcow@noos.fr>
0 siblings, 2 replies; 7+ messages in thread
From: P.A.M. van Dam @ 2004-06-25 19:37 UTC (permalink / raw)
To: pgsql-performance
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
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: How can one see what queries are running withing a
2004-06-25 19:37 How can one see what queries are running withing a postgres instance? P.A.M. van Dam <pam@pmg.xs4all.nl>
@ 2004-06-25 19:58 ` Roger Ging <roger@musicreports.com>
1 sibling, 0 replies; 7+ messages in thread
From: Roger Ging @ 2004-06-25 19:58 UTC (permalink / raw)
To: pam@pmg.xs4all.nl; +Cc: pgsql-performance
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.
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: How can one see what queries are running withing a postgres instance?
2004-06-25 19:37 How can one see what queries are running withing a postgres instance? P.A.M. van Dam <pam@pmg.xs4all.nl>
@ 2004-06-25 20:51 ` Hervé Piedvache <footcow@noos.fr>
2004-06-26 07:27 ` Re: How can one see what queries are running withing a postgres instance? Hervé Piedvache <footcow@noos.fr>
1 sibling, 1 reply; 7+ messages in thread
From: Hervé Piedvache @ 2004-06-25 20:51 UTC (permalink / raw)
To: pgsql-performance; pam@pmg.xs4all.nl
Let see in contrib/ the application pg_who ... you will see the process, the
queries, and the CPU ... ;o)
Regards,
Le vendredi 25 Juin 2004 21:37, P.A.M. van Dam a écrit :
> 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
--
Bill Footcow
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: How can one see what queries are running withing a postgres instance?
2004-06-25 19:37 How can one see what queries are running withing a postgres instance? P.A.M. van Dam <pam@pmg.xs4all.nl>
2004-06-25 20:51 ` Re: How can one see what queries are running withing a postgres instance? Hervé Piedvache <footcow@noos.fr>
@ 2004-06-26 07:27 ` Hervé Piedvache <footcow@noos.fr>
2004-06-26 08:58 ` Re: How can one see what queries are running withing a Christopher Kings-Lynne <chriskl@familyhealth.com.au>
0 siblings, 1 reply; 7+ messages in thread
From: Hervé Piedvache @ 2004-06-26 07:27 UTC (permalink / raw)
To: pgsql-performance; +Cc: pam@pmg.xs4all.nl
Sorry It's not in the contrib folder of PostgreSQL ... but you will find it on
gborg.postgresql.org !
Regards,
Le vendredi 25 Juin 2004 22:51, Hervé Piedvache a écrit :
> Let see in contrib/ the application pg_who ... you will see the process,
> the queries, and the CPU ... ;o)
>
> Regards,
>
> Le vendredi 25 Juin 2004 21:37, P.A.M. van Dam a écrit :
> > 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
--
Bill Footcow
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: How can one see what queries are running withing a
2004-06-25 19:37 How can one see what queries are running withing a postgres instance? P.A.M. van Dam <pam@pmg.xs4all.nl>
2004-06-25 20:51 ` Re: How can one see what queries are running withing a postgres instance? Hervé Piedvache <footcow@noos.fr>
2004-06-26 07:27 ` Re: How can one see what queries are running withing a postgres instance? Hervé Piedvache <footcow@noos.fr>
@ 2004-06-26 08:58 ` Christopher Kings-Lynne <chriskl@familyhealth.com.au>
2004-06-26 14:45 ` Re: How can one see what queries are running withing a Tom Lane <tgl@sss.pgh.pa.us>
2004-06-27 17:25 ` Re: How can one see what queries are running withing a P.A.M. van Dam <pam@ramoth.xs4all.nl>
0 siblings, 2 replies; 7+ messages in thread
From: Christopher Kings-Lynne @ 2004-06-26 08:58 UTC (permalink / raw)
To: Hervé Piedvache <footcow@noos.fr>; +Cc: pgsql-performance; pam@pmg.xs4all.nl
>>Let see in contrib/ the application pg_who ... you will see the process,
>>the queries, and the CPU ... ;o)
Even easier:
SELECT * FROM pg_stat_activity;
As a superuser.
Chris
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: How can one see what queries are running withing a
2004-06-25 19:37 How can one see what queries are running withing a postgres instance? P.A.M. van Dam <pam@pmg.xs4all.nl>
2004-06-25 20:51 ` Re: How can one see what queries are running withing a postgres instance? Hervé Piedvache <footcow@noos.fr>
2004-06-26 07:27 ` Re: How can one see what queries are running withing a postgres instance? Hervé Piedvache <footcow@noos.fr>
2004-06-26 08:58 ` Re: How can one see what queries are running withing a Christopher Kings-Lynne <chriskl@familyhealth.com.au>
@ 2004-06-26 14:45 ` Tom Lane <tgl@sss.pgh.pa.us>
1 sibling, 0 replies; 7+ messages in thread
From: Tom Lane @ 2004-06-26 14:45 UTC (permalink / raw)
To: Christopher Kings-Lynne <chriskl@familyhealth.com.au>; +Cc: Hervé Piedvache <footcow@noos.fr>; pgsql-performance; pam@pmg.xs4all.nl
Christopher Kings-Lynne <chriskl@familyhealth.com.au> writes:
> Even easier:
> SELECT * FROM pg_stat_activity;
But note you must enable stats_command_string to make this very useful.
regards, tom lane
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: How can one see what queries are running withing a
2004-06-25 19:37 How can one see what queries are running withing a postgres instance? P.A.M. van Dam <pam@pmg.xs4all.nl>
2004-06-25 20:51 ` Re: How can one see what queries are running withing a postgres instance? Hervé Piedvache <footcow@noos.fr>
2004-06-26 07:27 ` Re: How can one see what queries are running withing a postgres instance? Hervé Piedvache <footcow@noos.fr>
2004-06-26 08:58 ` Re: How can one see what queries are running withing a Christopher Kings-Lynne <chriskl@familyhealth.com.au>
@ 2004-06-27 17:25 ` P.A.M. van Dam <pam@ramoth.xs4all.nl>
1 sibling, 0 replies; 7+ messages in thread
From: P.A.M. van Dam @ 2004-06-27 17:25 UTC (permalink / raw)
To: Christopher Kings-Lynne <chriskl@familyhealth.com.au>; +Cc: Herv? Piedvache <footcow@noos.fr>; pgsql-performance
On Sat, Jun 26, 2004 at 04:58:16PM +0800, Christopher Kings-Lynne wrote:
>
> >>Let see in contrib/ the application pg_who ... you will see the process,
> >>the queries, and the CPU ... ;o)
>
> Even easier:
>
> SELECT * FROM pg_stat_activity;
>
> As a superuser.
Thanks!
That works as needed!
Best regards,
Pascal
>
> Chris
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faqs/FAQ.html
^ permalink raw reply [nested|flat] 7+ messages in thread
end of thread, other threads:[~2004-06-27 17:25 UTC | newest]
Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-06-25 19:37 How can one see what queries are running withing a postgres instance? P.A.M. van Dam <pam@pmg.xs4all.nl>
2004-06-25 19:58 ` Re: How can one see what queries are running withing a Roger Ging <roger@musicreports.com>
2004-06-25 20:51 ` Hervé Piedvache <footcow@noos.fr>
2004-06-26 07:27 ` Hervé Piedvache <footcow@noos.fr>
2004-06-26 08:58 ` Re: How can one see what queries are running withing a Christopher Kings-Lynne <chriskl@familyhealth.com.au>
2004-06-26 14:45 ` Re: How can one see what queries are running withing a Tom Lane <tgl@sss.pgh.pa.us>
2004-06-27 17:25 ` Re: How can one see what queries are running withing a P.A.M. van Dam <pam@ramoth.xs4all.nl>
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