Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TVAqq-0000Gp-4W for pgsql-admin@postgresql.org; Mon, 05 Nov 2012 00:47:40 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TVAqm-0004fR-OO for pgsql-admin@postgresql.org; Mon, 05 Nov 2012 00:47:39 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.5/8.14.5) with ESMTP id qA50lZft027618; Sun, 4 Nov 2012 19:47:36 -0500 (EST) From: Tom Lane To: Tore Halset cc: "pgsql-admin@postgresql.org" Subject: Re: autovacuum with lots of open file references to deleted files In-reply-to: <347905F6-B93E-4259-A8A9-28DBAC51D014@pvv.ntnu.no> References: <7015.1350260875@sss.pgh.pa.us> <347905F6-B93E-4259-A8A9-28DBAC51D014@pvv.ntnu.no> Comments: In-reply-to Tore Halset message dated "Sun, 04 Nov 2012 22:38:07 +0100" Date: Sun, 04 Nov 2012 19:47:35 -0500 Message-ID: <27617.1352076455@sss.pgh.pa.us> X-Pg-Spam-Score: -2.3 (--) X-Archive-Number: 201211/15 X-Sequence-Number: 40260 Tore Halset writes: > On Oct 15, 2012, at 2:27 AM, Tom Lane wrote: >> Tore Halset writes: >>> On this box I drop a 80GB database each night followed by a restore of a similar sized database. It is a restore of our production database to a development server. This box is running 9.2rc1 (sorry). >>> du and df reported quite different numbers and lsof show that autovacuum is holding lots of deleted files. After killing the autovacuum daemon, some disk space was restored and the du and df numbers was more equal. >> Hm. I've been able to reproduce some leakage of file descriptors in the >> autovac launcher, but it required (a) fairly small shared_buffers and >> (b) very heavy update activity on large tables. So I'm not sure that it >> would explain the consistent leakage you seem to be seeing. Can you >> tell us more about your usage pattern on the development server? > A cron job dropdb one of the databases and createdb it and then pg_restore. Roughly 80GB dump. So far, my guess is that this is fixed by commits a1f064fc2 + d7598aeea. > Out production PostgreSQL running a 9.1 variant does not have this problem. It does not have the nightly dropdb/createdb/pg_restore, but otherwise similar usage patterins. It is also configured to use more memory. 9.1 has the same bug (and the same patches), but I think that the aspect you're running into is specific to DROP DATABASE scenarios. regards, tom lane