Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search archives
  Advanced Search

Re: Stale entries in pg_stat_activity


  • From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
  • To: Michael Fuhr <mike(at)fuhr(dot)org>
  • Cc: pgsql-bugs(at)postgresql(dot)org
  • Subject: Re: Stale entries in pg_stat_activity
  • Date: Sun, 17 Oct 2004 13:35:40 -0400
  • Message-id: <9224.1098034540@sss.pgh.pa.us> <text/plain>

Michael Fuhr <mike(at)fuhr(dot)org> writes:
>>>> pg_stat_activity sometimes shows old connections that have already
>>>> terminated.
>>> 
>>> Define "old"?  There's a built-in delay of up to half a second (if
>>> memory serves) in the statistics views.
>> 
>> Fourteen minutes and counting.

> Two hours and counting.  I've also reproduced the problem using
> pgbench against 8.0.0beta3 on FreeBSD 4.10-STABLE.

The other likely theory is that the stats subsystem is under
sufficiently heavy load that it drops a certain proportion of stats
messages (as it is designed to do, rather than causing foreground
activity to block).  If it were to drop a backend-termination message
then of course that connection would remain depicted in pg_stat_activity
until the stats collector figures out that the backend is gone.  Which
IIRC would normally happen when some new backend re-uses its BackendId
slot.

You could check for log messages "statistics buffer is full" as a
partial check of this theory.  This is only partial because it isn't
a direct test of whether messages are being dropped.

			regards, tom lane



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group