Re: V2 of PITR performance improvement for 8.4

From: "Koichi Suzuki" <koichi(dot)szk(at)gmail(dot)com>
To: "Simon Riggs" <simon(at)2ndquadrant(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: V2 of PITR performance improvement for 8.4
Date: 2008-12-03 05:22:14
Message-ID: a778a7260812022122k7166e118rda74114970bc48d5@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

As to checkpoint timeout, yes, this measurement is hard for FPW=on
case. I'll do the similar measurement for checkpoint timeout = 5min
and post the result. I expect that the recoevry time will be almost
the same in the case FPW=on, lesslog=yes and prefetpch = yes.

2008/12/2 Simon Riggs <simon(at)2ndquadrant(dot)com>:
>
> On Thu, 2008-11-27 at 21:04 +0900, Koichi Suzuki wrote:
>
>> We ran the
>> benchmark for on hour with chekpoint timeout 30min and completion_target 0.5.
>> Then, collected all the archive log and run PITR.
>
>> ----------------------+------------+--------------------+---------------
>> WAL conditions | Recovery | Amount of | recovery
>> | time (sec) | physical read (MB) | rate (TX/min)
>> ----------------------+------------+--------------------+---------------
>> w/o prefetch | | |
>> archived with cp | 6,611 | 5,435 | 402
>> FPW=off | | |
>> ----------------------+------------+--------------------+---------------
>> With prefetch | | |
>> archived with cp | 1,161 | 5,543 | 2,290
>> FPW=off | | |
>> ----------------------+------------+--------------------+---------------
>
> There's clearly a huge gain using prefetch, when we have
> full_page_writes = off. But that does make me think: Why do we need
> prefetch at all if we use full page writes? There's nothing to prefetch
> if we can keep it in cache.

Agreed. This is why I proposed prefetch optional through GUC.

>
> I notice we set the checkpoint_timeout to 30 mins, which is long enough
> to exceed the cache on the standby. I wonder if we reduced the timeout
> would we use the cache better on the standby and not need readahead at
> all? Do you have any results to examine cache overflow/shorter timeouts?
>
>> w/o prefetch | | |
>> archived with cp | 1,683 | 801 | 1,458
>> FPW=on | | | (8.3)
>> ----------------------+------------+--------------------+---------------
>> w/o prefetch | | |
>> archived with lesslog | 6,644 | 5,090 | 369
>> FPW=on | | |
>> ----------------------+------------+--------------------+---------------
>> With prefetch | | |
>> archived with cp | 1,415 | 2,157 | 1,733
>> FPW=on | | |
>> ----------------------+------------+--------------------+---------------
>> With prefetch | | |
>> archived with lesslog | 1,196 | 5,369 | 2,051
>> FPW=on | | | (This proposal)
>> ----------------------+------------+--------------------+---------------
>
> So I'm wondering if we only need prefetch because we're using lesslog?
>
> If we integrated lesslog better into the new replication would we be
> able to forget about doing the prefetch altogether?

In the case of lesslog, almost all the FPW is replaced with
corresponding incremental log and recovery takes longer. Prefetch
dramatically improve this, as you will see in the above result. To
improve recovery time with FPW=off or FPW=on and lesslog=yes, we need
prefetch.
>
> --
> Simon Riggs www.2ndQuadrant.com
> PostgreSQL Training, Services and Support
>
>

--
------
Koichi Suzuki

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Koichi Suzuki 2008-12-03 05:24:34 Re: where is the last hot standby patch?
Previous Message Fujii Masao 2008-12-03 05:00:20 Re: Sync Rep: First Thoughts on Code