Killing a child process

Lists: pgsql-admin
From: "Bojan Belovic" <bbelovic(at)usa(dot)net>
To: <pgsql-admin(at)postgresql(dot)org>
Subject: Killing a child process
Date: 2002-04-16 00:11:18
Message-ID: DCEJKACCHKFOPHFEPKPIMECKCFAA.bbelovic@usa.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-admin

Every once in a while I'll spot a query that is taking unusually long time
to run (a chiled process that keeps the processor at 100% for like 3
minutes). Is there a way to see the queries currently executing and/or kill
a single process without affecting the operation of the server (I'm not
sure, but I think I tried a simple kill once and that it killed the whole
server)?

Thanks,
Bojan


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Bojan Belovic" <bbelovic(at)usa(dot)net>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Killing a child process
Date: 2002-04-16 00:28:58
Message-ID: 7605.1018916938@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-admin

"Bojan Belovic" <bbelovic(at)usa(dot)net> writes:
> Every once in a while I'll spot a query that is taking unusually long time
> to run (a chiled process that keeps the processor at 100% for like 3
> minutes). Is there a way to see the queries currently executing

ps, top? Also see the stats views, if you are running 7.2.

> and/or kill
> a single process without affecting the operation of the server

kill -INT to a backend will issue a query cancel, which is pretty safe.

regards, tom lane


From: David Stanaway <david(at)stanaway(dot)net>
To: pgsql-admin(at)postgresql(dot)org
Subject: Re: Killing a child process
Date: 2002-04-16 05:06:55
Message-ID: 1018933616.1888.30.camel@debian
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-admin

On Mon, 2002-04-15 at 19:28, Tom Lane wrote:
> "Bojan Belovic" <bbelovic(at)usa(dot)net> writes:
> > Every once in a while I'll spot a query that is taking unusually long time
> > to run (a chiled process that keeps the processor at 100% for like 3
> > minutes). Is there a way to see the queries currently executing
>
> ps, top? Also see the stats views, if you are running 7.2.
>
> > and/or kill
> > a single process without affecting the operation of the server
>
> kill -INT to a backend will issue a query cancel, which is pretty safe.

There is also pgmonitor (Which I think is in contrib) which shows the
stats on the current backend processes (Works on 7.1.3 for me) and is
much nicer for working out whats using CPU, and the query that is
causing the problem.

--
David Stanaway