Thread: WARNING : pgstat wait timeout - stats_temp_directory - postgres 9.1

WARNING : pgstat wait timeout - stats_temp_directory - postgres 9.1

From
Mathieu Guerin
Date:
Hello,

I am facing a problem with pgstat as my subject says. I known, some topics are open about that, but I would like to go deeper.

Some person told that the better way to don't have this message anymore is to configure pgstat.stat to be loaded in the RAM with a tmpfs mount point.

What are the consequences ? Because this file will be remove if the server reboot.

If we change the parameter stats_temp_directory is it necessary to reboot the server ?

When I lauch a SHOW ALL; command, the parameter stats_temp_director is not here.

For information, my pgstat.stat file is up to 1,3MB.

Thank you for your help.
Math



Re: WARNING : pgstat wait timeout - stats_temp_directory - postgres 9.1

From
Alvaro Herrera
Date:
Mathieu Guerin escribió:
> Hello,
> 
> I am facing a problem with pgstat as my subject says. I known, some topics
> are open about that, but I would like to go deeper.
> 
> Some person told that the better way to don't have this message anymore is
> to configure pgstat.stat to be loaded in the RAM with a tmpfs mount point.
> 
> What are the consequences ? Because this file will be remove if the server
> reboot.

There are two separate files, one is the temp file which is used while
the server is running and is written very frequently.  You put that one
on volatile storage (stats_temp_directory) and immediately see a
performance benefit.

The other one is the permanent file, which is written only once when the
system is shutting down.  This is not put in stats_temp_directory, so
it's safe.

In case of a crash (the server didn't have the chance to write the
permanent file), stats would be reset anyway at restart, so there's no
conceptual problem with the permanent file not being written.

> If we change the parameter stats_temp_directory is it necessary to reboot
> the server ?

No, a reload (pg_ctl reload) is sufficient.

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services