Skip site navigation (1) Skip section navigation (2)

Postgres 9 slave lag

From: Saurabh Agrawal <saurabh(dot)miet(at)gmail(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: Postgres 9 slave lag
Date: 2011-04-11 14:12:36
Message-ID: BANLkTi=zxUiKAzcB2JLf=fhkog6tLbfTAw@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-admin
Hi All,

I have setup postgres 9 master slave streaming replication but
experiencing slave lagging sometimes by 50 min to 60 min. I am not
getting exact reason for slave lag delay. Below are the details:

1. Master table contains partition tables with frequent updates.
2. Slave is used for report generation so long running queries hit slave.
3. ANALYZE runs every hour on partition table on master.
4. postgresql.conf:
archive_timeout = 900
checkpoint_segments = 500
checkpoint_timeout = 30min
checkpoint_warning = 2000s
max_standby_archive_delay = -1

I noticed that whenever long running query executes on slave, slave
starts lagging by master and as soon as query completes log files get
applied immediately. Please help how can I avoid slave lag.

Thanks

Regards
Saurabh Agrawal

Responses

pgsql-admin by date

Next:From: Kevin GrittnerDate: 2011-04-11 15:47:12
Subject: Re: pg_start_backup - backups
Previous:From: GnanakumarDate: 2011-04-11 06:05:10
Subject: Re: DB Import Error...

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group