更新2022-11-10:我已经为这件事开了一个AWS的案子,一旦他们回复,我会在这里告诉你。。
Postgres 12.9 AWS是在db.r5.4xlarge上管理的,它有64 on内存。
autovacuum_vacuum_cost_limit为1800:
select setting from pg_settings where name = 'autovacuum_vacuum_cost_limit'; -- 1800
AWS控制台中的参数组:
autovacuum_vacuum_cost_limit: GREATEST({log(DBInstanceClassMemory/21474836480)*600},200)
rds.adaptive_autovacuum: 1
autovacuum_vacuum_cost_limit IMHO的计算:
64 Gigabytes = 68,719,476,736 Bytes
GREATEST({log(68719476736/21474836480)*600},200)
GREATEST({log(3.2)*600},200)
GREATEST({0.50514997832*600},200)
GREATEST(303.089986992,200)
CloudWatch米制MaximumUsedTransactionIDs徘徊在200米左右。许多桌子接近2亿元。
所以autovacuum_vacuum_cost_limit 应该是303IMHO?为什么autovacuum_vacuum_cost_limit 在1800点?我想是303。我想我可以排除人工干预。谢谢,
发布于 2022-11-15 10:00:56
这是aws的答案。简言之,这一解释有两个方面:
的某一点上四舍五入
The autovacuum_vacuum_cost_limit formula is GREATEST({log(DBInstanceClassMemory/21474836480)*600},200).
Log in above formula is log of base 2 and the log value is rounded off before it is multiplied by 600.
As your instance's instance type is r5.2xlarge, the instance class memory is 64 gb.
DBInstanceClassMemory= 64 GiB =68719476736 bytes
Therefore, the following calculation is used to calculate the autovacuum_vacuum_cost_limit value:
GREATEST({log(68719476736/21474836480)600},200)
= GREATEST({log(3.2)600},200) --> log base 2 of (3.2) is 1.678 which is rounded off to 2
= GREATEST({2*600},200)
= GREATEST({1200},200)
= 1200https://stackoverflow.com/questions/73975489
复制相似问题