Re: using stale statistics instead of current ones because stats collector is not responding

From: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>
To: Tory M Blue <tmblue(at)gmail(dot)com>
Cc: pgsql-performance <pgsql-performance(at)postgresql(dot)org>
Subject: Re: using stale statistics instead of current ones because stats collector is not responding
Date: 2016-03-09 11:37:47
Message-ID: 1457523467.24545.43.camel@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Hi,

On Tue, 2016-03-08 at 16:18 -0800, Tory M Blue wrote:
> No hits on the intratubes on this.
>
>
> Any idea ? We are doing some massive deletes so was curious as to what
> would cause this error. The DB is up, not overburdened, just some big
> deletes and slon replication processes.
>
> CentOS 6.6
> Postgres 9.4.5
>
> First time I've ever seen this alert/error just curious about it.
>
> 2016-03-08 16:17:29 PST 11877 2016-03-08 16:17:29.850 PSTLOG:
> using stale statistics instead of current ones because stats collector
> is not responding

PostgreSQL tracks 'runtime statistics' (number of scans of a table,
tuples fetched from index/table etc.) in a file, maintained by a
separate process (collector). When a backed process requests some of the
stats (e.g. when a monitoring tool selects from pg_stat_all_tables) it
requests a recent snapshot of the file from the collector.

The log message you see means that the collector did not handle such
requests fast enough, and the backend decided to read an older snapshot
instead. So you may see some stale data in monitoring for example.

This may easily happen if the I/O system is overloaded, for example. The
simplest solution is to move the statistics file to RAM disk (e.g. tmpfs
mount on Linux) using stats_temp_directory in postgresql.conf.

The space neede depends on the number of objects (databases, tables,
indexes), and usually it's a megabyte in total or so.

regards

--
Tomas Vondra http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Jim Nasby 2016-03-11 16:37:35 Re: [SPAM] Re: Architectural question
Previous Message Tory M Blue 2016-03-09 00:18:19 using stale statistics instead of current ones because stats collector is not responding