Re: BUG #12834: Avoiding Disk Control Writes for better Laptop / SSD compatibility. pgstats

From: Bryce Nesbitt <bryce2(at)obviously(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #12834: Avoiding Disk Control Writes for better Laptop / SSD compatibility. pgstats
Date: 2015-03-05 19:37:58
Message-ID: CAC9LFPenveGXu7YhOv6L6fmmhN6NFq3L23aQsts+JKLbsaDvkQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Thu, Mar 5, 2015 at 10:23 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> bryce2(at)obviously(dot)com writes:
>> Every minute postgresql runs the "stats" process which writes the following
>> files:
>
>> postgres(3814): CW /var/lib/postgresql/9.4/main/pg_stat_tmp/db_0.tmp
>> postgres(3814): CW /var/lib/postgresql/9.4/main/pg_stat_tmp/global.tmp
>> postgres(3814): CW /var/lib/postgresql/9.4/main/pg_stat_tmp/db_12066.tmp
>> postgres(3814): CW /var/lib/postgresql/9.4/main/pg_stat_tmp/global.stat
>> postgres(568): CW /var/lib/postgresql/9.4/main/base/12066/11868
>> unknown(568): CW /var/lib/postgresql/9.4/main/global/12062
>> unknown(568): CW /var/lib/postgresql/9.4/main/base/12066/11828
>> unknown(568): CW /var/lib/postgresql/8.4/main/base/12066/11833
>
> The stats collector only writes something when asked to. In this
> case what's asking for stats is probably the autovacuum launcher.
> You could dial back the autovacuum naptime if you want fewer
> autovacuum wakeups.

I'm aware that it's possible to configure postgres for fewer wakeups.
This report is more about the default configuration, and about
teaching autovaccum/stats to do nothing if the cluster has been idle.

Given the size of these files, the cumulative impact on a consumer SSD
is pretty high. Chances are most people will leave naptime at the
default value in small setups. In big setups this does not matter, as
enterprise disks are set up for this level of wear.

Is autovac writing anything of import during its periodic wakeup on an
idle cluster?

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Alvaro Herrera 2015-03-05 19:44:57 Re: BUG #12834: Avoiding Disk Control Writes for better Laptop / SSD compatibility. pgstats
Previous Message Tom Lane 2015-03-05 18:23:01 Re: BUG #12834: Avoiding Disk Control Writes for better Laptop / SSD compatibility. pgstats