Re: Slow PITR restore - Mailing list pgsql-general

From Tom Lane
Subject Re: Slow PITR restore
Date
Msg-id 766.1197509539@sss.pgh.pa.us
Whole thread Raw
In response to Re: Slow PITR restore  ("Joshua D. Drake" <jd@commandprompt.com>)
Responses Re: Slow PITR restore  ("Joshua D. Drake" <jd@commandprompt.com>)
Re: Slow PITR restore  (Gregory Stark <stark@enterprisedb.com>)
REINDEX on large DB vs. DROP INDEX/CREATE INDEX  (Wes <wespvp@msg.bt.com>)
List pgsql-general
"Joshua D. Drake" <jd@commandprompt.com> writes:
> Jeff Trout <threshar@threshar.is-a-geek.com> wrote:
>> in this case it was 24hrs of data - about 1500 wal segments.  During
>> this time the machine was nearly complete idle and there wasn't very
>> much IO going on (few megs/sec).

> Exactly. Which is the point I am making. Five minutes of transactions
> is nothing (speaking generally).. In short, if we are in recovery, and
> we are not saturated the I/O and at least a single CPU, there is a huge
> amount of optimization *somewhere* to be done.

You sure about that?  I tested CVS HEAD just now, by setting the
checkpoint_ parameters really high, running pgbench for awhile, and
then killing the bgwriter to force a recovery cycle over all the WAL
generated by the pgbench run.  What I saw was that the machine was 100%
disk write bound.  Increasing shared_buffers helped, not in that the
write rate got less according to vmstat, but the completion time did.

shared_buffers            32MB    100MB

pgbench -c 5 -t 40000 bench    7m23s    2m20s
subsequent recovery        4m26s    2m21s

Typical "vmstat 1" lines during recovery:

procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
 0  9  70024  29232  19876 824368    0    0     0  3152 1447  233  0  1  0 99  0
 0  9  70024  29232  19876 824368    0    0     0  3660 1474  252  0  1  0 99  0
 0  8  70024  28960  19876 824404    0    0     0  3176 1448  265  0  2  1 97  0

I don't see the machine sitting around doing nothing ...

            regards, tom lane

pgsql-general by date:

Previous
From: Jorge Godoy
Date:
Subject: Re: Hijack!
Next
From: "Merlin Moncure"
Date:
Subject: Re: what is the date format in binary query results