# 加速独立运行 Discourse 的最佳配置

**URL:** <https://meta.discourse.org/t/best-configurations-for-speeding-up-standalone-discourse/162456>\
**Category:** Self-hosting\
**Tags:** server-resources\
**Created:** [2020 年8 月 30 日 07:39 UTC](https://meta.discourse.org/t/best-configurations-for-speeding-up-standalone-discourse/162456 "2020-08-30T07:39:37Z")\
**Posts on this page:** 1\
**Showing post:** 14

<div class="post-metadata">

**Author:** ![nildarar](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nildarar/32/331927_2.png) [@nildarar](https://meta.discourse.org/u/nildarar)\
**Post date:** [2020 年9 月 1 日 03:12 UTC](https://meta.discourse.org/t/best-configurations-for-speeding-up-standalone-discourse/162456/14 "2020-09-01T03:12:24Z")

</div>

感谢您的指导。直到几个月前，我们还使用 Cloudflare CDN 服务，并通过页面规则对静态内容进行了有效的优化。之后，我读到一些资料称，使用像 Cloudflare 这样的代理会显著降低 Discourse 的性能，因此我们将其禁用了。

昨天，我们将 CPU 核心数从 16 增加到 24，并在 app.yml 中进行了以下更改：

```
params:
  # db_shared_buffers: "6GB"
  db_shared_buffers: "7GB"
env:
  # UNICORN_WORKERS: 16
  UNICORN_WORKERS: 24

```

通过这些更改，我们的问题暂时得到了解决，但我认为在未来几个月内，我们需要进行根本性的调整。

因此，根据您的建议，使用 CDN 提供静态内容以及将 Discourse 拆分为两个独立的容器，在性能优化方面具有更高的优先级。

---

_[View the full topic](https://meta.discourse.org/t/best-configurations-for-speeding-up-standalone-discourse/162456)._
