# 加速独立运行 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:** 26

<div class="post-metadata">

**Author:** ![ckshen](https://avatars.discourse-cdn.com/v4/letter/c/ad7895/32.png) [@ckshen](https://meta.discourse.org/u/ckshen)\
**Post date:** [2024 年2 月 14 日 18:52 UTC](https://meta.discourse.org/t/best-configurations-for-speeding-up-standalone-discourse/162456/26 "2024-02-14T18:52:52Z")

</div>

> [@RGJ](#):
>
> If you’re not seeing 502’s then there is no use in increasing `UNICORN_WORKERS` either.

502 错误是什么原因？是 unicorn 工作进程不足吗？我们刚迁移了服务器，用户在迁移后偶尔会报告 502 错误。我们有一个 6 核/16GB 的服务器，将 `unicorn_workers` 设置为 16（迁移服务器之前是 12），`db_shared_buffer` 设置为 4GB，`db_work_mem` 设置为 60MB。

过多的 unicorn 工作进程是否会导致 502 错误？（推测，因为在服务器迁移之前我们有 4 个更少的工作进程）

我正在尝试确定是需要调整配置还是需要解决其他问题。

谢谢。

---

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