X-Original-To: pgsql-docs@postgresql.org Received: from iguana.simplexity.net (adsl-216-103-84-145.dsl.snfc21.pacbell.net [216.103.84.145]) by postgresql.org (Postfix) with ESMTP id C5EF8475956 for ; Wed, 5 Mar 2003 20:33:13 -0500 (EST) Received: from localhost (ofx8gq1j1kb4biwf@localhost [127.0.0.1]) by iguana.simplexity.net (8.12.3/8.12.3) with ESMTP id h261XFQ1082991; Wed, 5 Mar 2003 17:33:16 -0800 (PST) (envelope-from ocrow@simplexity.net) Date: Wed, 5 Mar 2003 17:33:15 -0800 (PST) From: Oliver Crow To: "Delao, Darryl W" Cc: pgsql-docs@postgresql.org Subject: Re: Monitoring In-Reply-To: Message-ID: <20030305170814.W82803-100000@iguana.simplexity.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200303/7 X-Sequence-Number: 1685 On Wed, 5 Mar 2003, Delao, Darryl W wrote: > Anyone aware of any tool or command line option to view active and inactive > postgres connections? Is there a setting in postgres that sets the > Time_Wait to something lower? Also, is there a command to kill a specific > connection at any given time? Postgres starts a server process for each client connection. You can use /bin/ps to show the active connection processes. The process command string gives some information about what each connection is doing -- the user and database being used, whether the connection is idle or processing a query and the type of the query, as well as whether it's in a transaction. You can kill a connection, simply by killing the corresponding postgres process. % ps -auwwx | grep ^pgsql pgsql 52081 Tue03PM 0:02.27 /usr/local/bin/postmaster (postgres) pgsql 52082 Tue03PM 0:00.20 postmaster: stats buffer process (postgres) pgsql 52084 Tue03PM 0:00.98 postmaster: stats collector process (postgres) pgsql 65062 5:05PM 0:04.25 postmaster: ocrow ocrow [local] SELECT (postgres) pgsql 65071 5:05PM 0:00.04 postmaster: ocrow ocrow [local] idle (postgres) In this list process 65062 is executing a select query, and 65071 is idle. Oliver