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

From: bryce2(at)obviously(dot)com
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #12834: Avoiding Disk Control Writes for better Laptop / SSD compatibility. pgstats
Date: 2015-03-05 18:14:32
Message-ID: 20150305181432.2529.76377@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 12834
Logged by: Bryce Nesbitt
Email address: bryce2(at)obviously(dot)com
PostgreSQL version: 9.4.1
Operating system: Linux
Description:

This is an issue primarily for home computers and laptops which run
postgres, but not under heavy load.

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

This data was collected with "fatrace". There's one set of writes per
installed version of postgres on the test system (8.1,9.1,9.3,9.4).

----

Would it be possible to have the stats process take no action and make no
writes to the disk, if there has been no database activity in the interval?

---
For laptops disk writes wake up the machine and/or harddrive. For SSD's
it's a wear leveling issue. With this write happening 24/7 on millions of
computers this is also an energy use optimization potential (reduce
electricity use from your keyboard!)

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2015-03-05 18:23:01 Re: BUG #12834: Avoiding Disk Control Writes for better Laptop / SSD compatibility. pgstats
Previous Message Andres Freund 2015-03-05 17:36:42 Re: BUG #12833: Cannot cancel query or terminate backend if it client is SIGSTOPed