有4种配置可启用并行并进行优化,但是文档并没有说明任何有关值或计算的内容。我的问题是:
There are 4 configurations to enable the parallel and do the optimization, but the documentation of PostgreSQL doesn't says anything about values or calculation. My questions are:
1-如何计算 max_parallel_workers ,$的值b $ b max_parallel_workers_per_gather 和 max_worker_processes ?
1- How to calculate the values of max_parallel_workers, max_parallel_workers_per_gather and max_worker_processes?
2- work_mem 可以基于连接和内存(RAM)计算,但是 work_mem 需要如果我启用并行功能,则需要更改某些内容吗?
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个内核 max_parallel_workers 是8,工作进程和每个收集的值是32(8 * 4),我从原始配置中得到的数字4是每1个并行工作收集4个收集。
My supposition is: if the machine has 8 cores the max_parallel_workers is 8 and the values of worker process and per gather are 32(8*4), the number 4 I took from the original configuration that is 4 gathers per 1 parallel work.
推荐答案在进行一些搜索后,我找到了一些答案,如果您有4个核心,这可以帮助想要启用并具有基本配置的人( CPU):
After some searching I found some answers, this can help who wants to enable and to have a base configuration, case you have 4 cores(CPU):
您的最大辅助进程将是核心数量,并且最大并行需要具有相同的amo unt:
your max worker processes will be the amount of cores and the max parallel needs to have the same amount:
max_worker_processes = 4 max_parallel_workers = 4收集更为复杂,因为可以根据您的需求和资源来操纵此值,有必要进行测试以获取最佳价值,但是对于启动值,您可以使用cores / 2。
the gather is more complex because this value can be manipulated base on your needs and resource it is necessary to test to get a best value, but to startup values you can use cores/2.
max_parallel_workers_per_gather = 2这不是最终答案,有一些遗漏的地方...我仍在搜索和更新此答案或等待更好的答案。
This is not a final answer, there some missing points... I am still searching and updating this answer or waiting for a better one.
更多推荐
Postgresql 10
发布评论