gpt4 book ai didi

Postgresql 10 - 并行配置

转载 作者:行者123 更新时间:2023-11-29 11:25:31 25 4
gpt4 key购买 nike

有 4 种配置可以启用并行并进行优化,但是 documentation PostgreSQL 没有说明任何关于值或计算的内容。我的问题是:

1- How to calculate the values of max_parallel_workers, max_parallel_workers_per_gather and max_worker_processes?

2- The work_mem can be calculate on base of connections and memory(RAM), but the work_mem needs to change something if I enable the parallel?

我的假设是:如果机器有 8 个核心 the max_parallel_workers 是 8 并且 worker process 和 per gather 的值是 32(8*4),我从原始配置中取的数字 4即每 1 个并行工作有 4 个聚集。

最佳答案

经过一些搜索我找到了一些答案,这可以帮助那些想要启用和拥有基本配置的人,如果你有 4 个核心 (CPU):

您的最大工作进程将是内核的数量,并且最大并行需要具有相同的数量:

max_worker_processes = 4
max_parallel_workers = 4

收集更复杂,因为可以根据您的需要和资源来操纵此值,有必要进行测试以获得最佳值,但要启动值,您可以使用 cores/2。

max_parallel_workers_per_gather = 2

这不是最终答案,还有一些遗漏...我仍在搜索和更新此答案或等待更好的答案。

关于Postgresql 10 - 并行配置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53059944/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com