pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Steinar H. Gunderson <sgunderson@bigfoot.com>
To: pgsql-performance@postgresql.org
Subject: Re: Kill a session
Date: Wed, 12 Jul 2006 19:04:04 +0200
Message-ID: <20060712170404.GA27392@uio.no> (raw)
In-Reply-To: <44B51896.1000808@modgraph-usa.com>
References: <6BCB9D8A16AC4241919521715F4D8BCEA0FAE8@algol.sollentuna.se>
	<44B51896.1000808@modgraph-usa.com>

On Wed, Jul 12, 2006 at 08:43:18AM -0700, Craig A. James wrote:
>> Then you killed the wrong backend...
>> No queries run in postmaster. They all run in postgres backends. The
>> postmaster does very little actual work, other than keeping track of
>> everybody else.
> 
> It turns out I was confused by this: ps(1) reports a process called 
> "postgres", but top(1) reports a process called "postmaster", but they both 
> have the same pid.  I guess postmaster replaces its own name in the process 
> table when it's executing a query, and it's not really the postmaster even 
> though top(1) calls it postmaster.
> 
> So "kill -15 <pid>" is NOT killing the process -- to kill the process, I 
> have to use signal 9.  But if I do that, ALL queries in progress are 
> aborted.  I might as well shut down and restart the database, which is an 
> unacceptable solution for a web site.

I don't follow your logic here. If you do "kill -15 <pid>" of the postmaster
doing the work, the query should be aborted without taking down the entire
cluster. I don't see why you'd need -9 (which is a really bad idea anyhow)...

> I'm back to my original question: How do you kill a runaway query without 
> bringing down the whole database?  Is there really no answer to this?

Kill it with -15. If you're worried about your CGI scripts, use sudo or some
sort of client/server solution.

/* Steinar */
-- 
Homepage: http://www.sesse.net/



view thread (14+ messages)  latest in thread

Message-ID: <20060712170404.GA27392@uio.no>
Permalink:  ../20060712170404.GA27392@uio.no/
Also on:    postgresql.org/message-id/20060712170404.GA27392@uio.no

 · 

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: sgunderson@bigfoot.com
  Subject: Re: Kill a session
  In-Reply-To: <20060712170404.GA27392@uio.no>

* 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