Re: Replaying 48 WAL files takes 80 minutes

From: Jeff Trout <threshar(at)real(dot)jefftrout(dot)com>
To: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
Cc: Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Replaying 48 WAL files takes 80 minutes
Date: 2012-10-29 18:36:36
Message-ID: B9F96C1F-D0D7-4151-8D15-04CCA93AC369@torgo.978.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance


On Oct 29, 2012, at 12:42 PM, Jeff Janes wrote:

> On Mon, Oct 29, 2012 at 6:05 AM, Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at> wrote:
>> I am configuring streaming replication with hot standby
>> with PostgreSQL 9.1.3 on RHEL 6 (kernel 2.6.32-220.el6.x86_64).
>> PostgreSQL was compiled from source.
>>
>> It works fine, except that starting the standby took for ever:
>> it took the system more than 80 minutes to replay 48 WAL files
>> and connect to the primary.
>>
>> Can anybody think of an explanation why it takes that long?
>
> Could the slow log files be replaying into randomly scattered pages
> which are not yet in RAM?
>
> Do you have sar or vmstat reports?
>

If you do not have good random io performance log replay is nearly unbearable. (I've run into this before many times)

Also, what io scheduler are you using? if it is cfq change that to deadline or noop.
that can make a huge difference.

--
Jeff Trout <jeff(at)jefftrout(dot)com

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Kevin Grittner 2012-10-29 18:51:14 Re: Setting Statistics on Functional Indexes
Previous Message Jeff 2012-10-29 18:27:06 Re: Replaying 48 WAL files takes 80 minutes