Hi,
We are facing similar problems but the lag is at replay on standby. How can I troubleshoot the replay lag.
ThanksSrinivas
Well, replay uses CPU and disk I/O. You should monitor both using
the OS tools. On Linux, Slowaris and AIX, that would be top, atop,
iotop, sar, iostat, nmon, dstat and alike. Also perf tools "perf
top" are useful. On Windows, that would be the performance
monitor. You first have to figure out where exactly is the
bottleneck. Then I would go about looking for newer version that
has improved on WAL replay. For instance, PostgreSQL 15 can do
parallel replay, which should speed things up, at least a bit.
Then, you should test the new version. After that you should
decide whether to beef up the hardware with or without upgrade. At
any rate, you should treat that like a project. Create a project
plan, define milestones, define how you test and what you test and
give it a go. You didn't specify the Postgres version or the OS,
so a generic answer like this is the best I can come up with.
Second best would be the answer to the question of life, universe
and everything. Good luck!
-- Mladen Gogala Database Consultant Tel: (347) 321-1217 https://dbwhisperer.wordpress.com