首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在Plone站点上调整RelStorage和PostgreSQL参数

在Plone站点上调整RelStorage和PostgreSQL参数
EN

Stack Overflow用户
提问于 2015-11-24 05:20:12
回答 1查看 394关注 0票数 3

我得到了很多次POSKeyError错误。我认为我们的设置不是足够的PostgreSQL参数。因为系统将存储从MySQL扩展到PostgreSQL。在成龙之前,我多次犯了这个错误。

请让我知道具体的设置或任何要点。

使用版本:

  • Plone 4.3.1
  • RelStorage 1.5.1与PostgreSQL在RDS、AWS上
  • 共享-blob-dir true (存储在文件系统上)
  • Plone快速上传1.8.2
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-11-24 08:01:58

以下是postgresql.conf中的一些PostgreSQL调优

代码语言:javascript
复制
# shared_buffers and effective_cache_size should be 30%-50%
# of your machine free memory

shared_buffers = 3GB
effective_cache_size = 2GB
checkpoint_segments = 64
checkpoint_timeout = 1h
max_locks_per_transaction = 512
max_pred_locks_per_transaction = 512

# If you know what you're doing you can uncomment and adjust the following values

#cpu_tuple_cost = 0.0030
#cpu_index_tuple_cost = 0.0001
#cpu_operator_cost = 0.0005

以下是詹斯·W·克莱因( Jens W. Klein)的解释:

  1. 最重要的是:shared_buffers = 3GB (将其设置为机器空闲内存的30%-50% )
  2. checkpoint_segments = 64,
  3. checkpoint_timeout = 1h (减少日志开销)
  4. max_locks_per_transaction = 512,
  5. max_pred_locks_per_transaction = 512 (需要大量的重存储)
  6. effective_cache_size = 4GB (调整到内存的50%)
  7. 只是为了导入,您可以在配置中禁用fsync,然后它应该非常快,但不要关闭机器。
  8. CPU调整。我们没有触及这些的默认值,但是如果你知道你在做什么,那就去做吧。下面是一些推荐值:
    • cpu_tuple_cost = 0.0030,
    • cpu_index_tuple_cost = 0.001,
    • cpu_operator_cost = 0.0005 (查询规划优化,缺省值是几年前的,所以当前cpus更快,这些是更好的估计,但我不知道如何获得“真实”值)

您还应该阅读Server

这是我们的buildout.cfg

代码语言:javascript
复制
[instance1]
recipe = plone.recipe.zope2instance
rel-storage =
  type postgresql
  host 10.11.12.13
  dbname datafs
  user zope
  password secret
  blob-dir /var/sharedblobstorage/blobs
  blob-cache-size 350MB
  poll-interval 0
  cache-servers 10.11.12.14:11211
  cache-prefix datafs
票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/33885986

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档