Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YTaIk-0007lB-Ne for pgsql-bugs@arkaria.postgresql.org; Thu, 05 Mar 2015 18:15:14 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YTaIj-0004XE-Gn for pgsql-bugs@arkaria.postgresql.org; Thu, 05 Mar 2015 18:15:13 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YTaIi-0004Vy-Hi for pgsql-bugs@postgresql.org; Thu, 05 Mar 2015 18:15:12 +0000 Received: from wrigleys.postgresql.org ([204.145.124.246]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YTaIY-00044U-Ml for pgsql-bugs@postgresql.org; Thu, 05 Mar 2015 18:15:10 +0000 MIME-Version: 1.0 Subject: BUG #12834: Avoiding Disk Control Writes for better Laptop / SSD compatibility. pgstats To: pgsql-bugs@postgresql.org From: bryce2@obviously.com Date: Thu, 05 Mar 2015 18:14:32 +0000 Message-ID: <20150305181432.2529.76377@wrigleys.postgresql.org> X-Pg-Spam-Score: -1.9 (-) Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org The following bug has been logged on the website: Bug reference: 12834 Logged by: Bryce Nesbitt Email address: bryce2@obviously.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!) -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs