Postgresql 10

编程入门 行业动态 更新时间:2024-10-26 18:27:43
本文介绍了Postgresql 10-并行配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

有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

本文发布于:2023-10-27 03:45:30,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1532212.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Postgresql

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!