PostgreSQL 10.0 preview 流复制增强 - 支持可配置的wal send max size
背景
以前的版本,wal sender进程使用流复制协议,将WAL信息发送给下游的wal receiver进程时,一次最多发送128KiB,是在宏中设置的。
现在允许用户设置GUC参数,来控制这个最大值。
在测试环境中设置为16MB有2倍的性能提升,可以更好的利用网络带宽,提升流复制的传输效率。
Attached please find a patch for PostgreSQL 9.4 which changes the maximum
amount of data that the wal sender will send at any point in time from the
hard-coded value of 128KiB to a user-controllable value up to 16MiB. It has
been primarily tested under 9.4 but there has been some testing with 9.5.
In our lab environment and with a 16MiB setting, we saw substantially
better network utilization (almost 2x!), primarily over high bandwidth
delay product links.
--
Jon Nelson
Dyn / Principal Software Engineer
这个patch的讨论,详见邮件组,本文末尾URL。
PostgreSQL社区的作风非常严谨,一个patch可能在邮件组中讨论几个月甚至几年,根据大家的意见反复的修正,patch合并到master已经非常成熟,所以PostgreSQL的稳定性也是远近闻名的。
参考
https://commitfest.postgresql.org/13/958/
https://www.postgresql.org/message-id/flat/CACJqAM2uAUnEAy0j2RRJOSM1UHPdGxCr=U-HbqEf0aAcdhUoEQ@mail.gmail.com#CACJqAM2uAUnEAy0j2RRJOSM1UHPdGxCr=U-HbqEf0aAcdhUoEQ@mail.gmail.com