小编har*_*aut的帖子

Postgres 流复制滞后,使用大量 CPU 和少量 I/O

我们有 2 个专用的数据库服务器。一个是主,另一个是它的流从。
Postgres 版本9.0.17

我们在两台服务器上都有类似的硬件,并在 Raid 10 中使用 15krpm SAS 驱动器用于数据库集群。唯一的区别是在服务器上我们有 128 GB 内存,而在从服务器上我们有 64 GB 内存。

我们面临的问题是我们的流媒体奴隶落后了。

在流式从属设备上,我们有

postgres=# select pg_last_xlog_receive_location();
 pg_last_xlog_receive_location
-------------------------------
 1F7D/DD3BA000


postgres=# select pg_last_xlog_replay_location();
 pg_last_xlog_replay_location
------------------------------
 1F75/5BE08980
Run Code Online (Sandbox Code Playgroud)

wal received 和 replay 之间的这种差异在不断增加。

请让我知道如何解决此问题。

的输出perf top -u postgres

98.30%  postgres          (.) DropRelFileNodeBuffers
0.20%  postgres          (.) 0x000000000008b05b
0.14%  (kernel)          (k) copy_user_generic_string
0.13%  postgres          (.) hash_seq_search
0.07%  postgres          (.) hash_search_with_hash_value
0.05%  (kernel)          (k) _spin_lock
0.05%  (kernel)          (k) apic_timer_interrupt
0.03%  (kernel)          (k) do_timer
0.03%  postgres …
Run Code Online (Sandbox Code Playgroud)

postgresql replication

5
推荐指数
1
解决办法
8434
查看次数

标签 统计

postgresql ×1

replication ×1