Standby server lagging behind
Standby server lagging behind
Hi
We are running postgres8.3.9 and have enabled log shipping replication. Our standby server is about 1000 files BEHIND – everything I’ve read indicates that the standby server should be very close behind the live server – at the rate we’re going it will take 8 hours to apply all the logs to standby! How can I speed up the recovery process on the standby server?
Some info
Live server –16CPU, 80G Ram
we write about 2to3 16MB WAL files per minute
These get copied to the standby so its all there, just not being applied fast enough.
Any advice would be most welcome
TaJ
Huda Booley
DBA | CareerJunction | Better jobs. More often.
Web: www.careerjunction.co.za |Email: huda@careerjunction.co.za
Phone: +27 21 818 8635 | Mobile: +27 82 9587818 | Fax: +27 21 818 8609
Disclaimer
This message contains information intended solely for the addressee, which is confidential or private in nature. If you are not the intended recipient, you may not peruse, use, disseminate, distribute or copy this message or any file attached to this message. Any such unauthorised use, is prohibited and may be unlawful. If you have received this message in error, please notify the sender immediately by e-mail, facsimile or telephone and thereafter delete the original message from your machine.
Furthermore, the information contained in this message, and any attachments thereto, is for information purposes only and may contain the personal views and opinions of the author, which are not necessarily the views and opinions of CareerJunction or its subsidiaries and associated companies. CareerJunction therefore does not accept liability for any claims, loss or damages of whatsoever nature, arising as a result of the reliance on such information by anyone.
Whilst all reasonable steps are taken to ensure the accuracy and integrity of information transmitted electronically and to preserve the confidentiality thereof, CareerJunction accepts no liability or responsibility whatsoever if information or data is, for whatever reason, incorrect, corrupted or does not reach its intended destination.
Re: Standby server lagging behind
"Huda Booley (huda@careerjunction.co.za)" wrote: > These get copied to the standby so its all there, just not being > applied fast enough. If the files are there and are not applying fast enough, it's probably because on the source machine you can have multiple connections submitting data modifications, keeping multiple CPUs and spindles busy all at the same time. When playing back the WAL files on the warm standby, you have one connection which has a harder time keeping a lot of resources busy. I think I have some recall of improvements to that in the 8.4 release, so an upgrade might help. Other than that, I think it's mostly a matter of your hardware and OS. Make sure you have a RAID controller with battery backed cache configured for write-back, spread the database across as many spindles as you can, don't worry so much about how *many* CPUs you have as how *fast* they are. I've never actually had this problem, so take my advice on it with a grain of salt. -Kevin
Re: Standby server lagging behind
On Fri, Jan 22, 2010 at 2:37 PM, Kevin Grittner wrote: > > I think I have some recall of improvements to that in the 8.4 > release, so an upgrade might help. There was a standalone program which you can call from your recovery script to prefetch the blocks needed to replay the next log file before starting to apply it. I find this message but there may be a more recent version if you search: http://archives.postgresql.org/pgsql-hackers/2008-11/msg01807.php Otherwise I think there were some performance improvements to replay but I don't recall which versions which improvements were in. -- greg