Too many .history file in pg_xlog takes lots of space

From: 彭昱傑 <k872892(at)gmail(dot)com>
To: pgsql-performance(at)postgresql(dot)org
Subject: Too many .history file in pg_xlog takes lots of space
Date: 2018-03-14 02:31:19
Message-ID: CALCPtXZZWvYgfY-FVmUL8rxV6OrY2JUrFP56CRaYCXqOworbkA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Hi team,

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):
-rw------- 1 pgsql pgsql 247K Mar 13 14:49 00001568.history
-rw------- 1 pgsql pgsql 247K Mar 13 14:51 00001569.history
-rw------- 1 pgsql pgsql 247K Mar 13 14:52 0000156A.history
-rw------- 1 pgsql pgsql 247K Mar 13 15:03 0000156B.history
-rw------- 1 pgsql pgsql 247K Mar 13 15:56 0000156C.history
-rw------- 1 pgsql pgsql 247K Mar 13 16:06 0000156D.history
-rw------- 1 pgsql pgsql 247K Mar 13 16:06 0000156E.history
-rw------- 1 pgsql pgsql 248K Mar 13 17:13 0000156F.history
-rw------- 1 pgsql pgsql 16M Mar 13 17:13 0000156F00000024000000F2
-rw------- 1 pgsql pgsql 248K Mar 13 17:13 00001570.history
-rw------- 1 pgsql pgsql 16M Mar 14 10:11 0000157000000024000000F2

Is file 00001570.history important?

When I do diff to these file I found new file just have a new line compared
to previous history file :
command:
diff 0000156F.history 00001570.history
result
10971a10972,10973
>
> 5487 24/F2000090 reached consistency

Is there a safety way to clean .history file?

1. Just save latest one?
2. Or remove history file which is marked as done
in pg_xlog/archive_status like:
-rw------- 1 pgsql pgsql 0 Mar 13 14:52 0000156A.history.done
-rw------- 1 pgsql pgsql 0 Mar 13 15:03 0000156B.history.done
-rw------- 1 pgsql pgsql 0 Mar 13 15:56 0000156C.history.done
-rw------- 1 pgsql pgsql 0 Mar 13 16:06 0000156D.history.done
-rw------- 1 pgsql pgsql 0 Mar 13 16:06 0000156E.history.done
-rw------- 1 pgsql pgsql 0 Mar 13 17:13 0000156F.history.done
-rw------- 1 pgsql pgsql 0 Mar 13 17:13 0000156F00000024000000F2.done
-rw------- 1 pgsql pgsql 0 Mar 13 17:13 00001570.history.done

Thanks.

By Pin

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Laurenz Albe 2018-03-14 05:56:52 Re: Too many .history file in pg_xlog takes lots of space
Previous Message dangal 2018-03-12 15:08:18 Re: Memory size