加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

PostgreSQL - Memory

发布时间:2020-12-13 17:39:17 所属栏目:百科 来源:网络整理
导读:Here is a list of recommended parameters for memory management in PostgreSQL. You should take into account mainly the following parameters. shared_bufferswork_memmaintenance_work_memeffective_cache_size About shared_buffers : Below 2GB,set
Here is a list of recommended parameters for memory management in PostgreSQL.

You should take into account mainly the following parameters.

shared_buffers
work_mem
maintenance_work_mem
effective_cache_size

Aboutshared_buffers:

  • Below 2GB,set to 20% of total system memory.
  • Below 32GB,set to 25% of total system memory.
  • Above 32GB,set to 8GB

Aboutwork_mem,this parameter can cause a huge speed-up if set properly,however it can use that amount of memory per planning node.
Here are some recommendations to set it up.

  • Start low: 32-64MB
  • Look for ‘temporary file’ lines in logs
  • Set to 2-3x the largest temp file

Aboutmaintenance_work_mem,here are some recommandations:

  • 10% of system memory,up to1GB
  • Maybe even higher if you are having VACUUM problems

Abouteffective_cache_size,here are some guidelines.

  • Set to the amount of file system cache available
  • If you don’t know,set it to 50% of total system memory

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读