Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1evzPL-0000TO-7s for pgsql-performance@arkaria.postgresql.org; Wed, 14 Mar 2018 05:57:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1evzPK-0001ty-7s for pgsql-performance@arkaria.postgresql.org; Wed, 14 Mar 2018 05:57:02 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1evzPJ-0001to-TY for pgsql-performance@lists.postgresql.org; Wed, 14 Mar 2018 05:57:02 +0000 Received: from mx1.mailbox.org ([80.241.60.212]) by makus.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1evzPG-0005su-G6 for pgsql-performance@postgresql.org; Wed, 14 Mar 2018 05:57:00 +0000 Received: from smtp2.mailbox.org (smtp2.mailbox.org [80.241.60.241]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.mailbox.org (Postfix) with ESMTPS id EE93042C34; Wed, 14 Mar 2018 06:56:54 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter03.heinlein-hosting.de (spamfilter03.heinlein-hosting.de [80.241.56.117]) (amavisd-new, port 10030) with ESMTP id KWbjC95OiWFZ; Wed, 14 Mar 2018 06:56:53 +0100 (CET) Message-ID: <1521007012.2368.3.camel@cybertec.at> Subject: Re: Too many .history file in pg_xlog takes lots of space From: Laurenz Albe To: =?UTF-8?Q?=E5=BD=AD=E6=98=B1=E5=82=91?= , pgsql-performance@postgresql.org Date: Wed, 14 Mar 2018 06:56:52 +0100 In-Reply-To: References: Organization: Cybertec Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 彭昱傑 wrote: > My postgre version is 9.4.9, and I face a space issue. > > Every time I restart postgre server, it generates a new history file: > 0000156A.history => 0000156B.history > > Now it takes a lot of space about 800MB (5787 history file): > [...] > Is file 00001570.history important? A new history file is created when a new timeline is opened, which happens after point-in-time-recovery or promotion of a physical standby server. There must be something weird in the way you start PostgreSQL. Examine the start script, maybe you can fix the problem. These files are only necessary for point-in-time-recovery, so you don't have to retain them any longer than you retain your WAL archives. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com