Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lM4mm-0002PU-6g for pgsql-hackers@arkaria.postgresql.org; Tue, 16 Mar 2021 08:10:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lM4mk-0003wg-O5 for pgsql-hackers@arkaria.postgresql.org; Tue, 16 Mar 2021 08:10:38 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lM4mk-0003wZ-HJ for pgsql-hackers@lists.postgresql.org; Tue, 16 Mar 2021 08:10:38 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lM4mg-0007Kc-I9 for pgsql-hackers@postgresql.org; Tue, 16 Mar 2021 08:10:38 +0000 Received: from hnk.local (p2350207-ipbf2126funabasi.chiba.ocn.ne.jp [114.167.184.207]) by oss.nttdata.com (Postfix) with ESMTPSA id 9EB4C627E5; Tue, 16 Mar 2021 17:10:28 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.102.3 at oss.nttdata.com Subject: Re: fdatasync performance problem with large number of DB files To: Thomas Munro , Tom Lane Cc: Michael Brown , pgsql-hackers References: <11bc2bb7-ecb5-3ad0-b39f-df632734cd81@discourse.org> <2255953.1615421770@sss.pgh.pa.us> <2258680.1615425905@sss.pgh.pa.us> From: Fujii Masao Message-ID: <6d4a78fa-f18a-e40c-8e39-a069f9d9bca8@oss.nttdata.com> Date: Tue, 16 Mar 2021 17:10:28 +0900 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2021/03/15 8:33, Thomas Munro wrote: > On Mon, Mar 15, 2021 at 11:52 AM Thomas Munro wrote: >> Time being of the essence, here is the patch I posted last year, this >> time with a GUC and some docs. You can set sync_after_crash to >> "fsync" (default) or "syncfs" if you have it. > > Cfbot told me to add HAVE_SYNCFS to Solution.pm, and I fixed a couple of typos. Thanks for the patch! + When set to fsync, which is the default, + PostgreSQL will recursively open and fsync + all files in the data directory before crash recovery begins. Isn't this a bit misleading? This may cause users to misunderstand that such fsync can happen only in the case of crash recovery. Regards, -- Fujii Masao Advanced Computing Technology Center Research and Development Headquarters NTT DATA CORPORATION