# "who's online" 插件的好处？

**URL:** <https://meta.discourse.org/t/benefits-of-the-whos-online-plugin/165583>\
**Category:** Community Building\
**Tags:** whos-online\
**Created:** [2020年九月28日 08:07 UTC](https://meta.discourse.org/t/benefits-of-the-whos-online-plugin/165583 "2020-09-28T08:07:55Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![mcdanlj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcdanlj/32/131829_2.png) [@mcdanlj](https://meta.discourse.org/u/mcdanlj)\
**Post date:** [2021年一月29日 13:32 UTC](https://meta.discourse.org/t/benefits-of-the-whos-online-plugin/165583/7 "2021-01-29T13:32:46Z")

</div>

Maker Forums 拥有庞大的用户群，但很少有足够的用户同时在线以触发“谁在线”头像显示的折叠。我们发现，“谁在线”插件是导致性能迟缓的元凶，甚至会导致请求超时，即便只有少数用户在线。我们使用[带有离线页面的外部 nginx 配置](https://meta.discourse.org/t/adding-an-offline-page-when-rebuilding/45238)，由于这些超时请求，我们甚至在未进行维护时也会定期显示维护页面。

> **[Re-enabled "Who's Online" plugin](https://forum.makerforums.info/t/re-enabled-whos-online-plugin/82364)**
>
> I have really enjoyed being able to see who is online. However, I have finally traced down some persistent site performance issues to the discourse plugin that provides the display of who is online. If you have ever experienced intermittent...

在从 DigitalOcean Spaces 迁移后，我们本地提供图像服务，这导致了 Unicorn 工作进程之间的资源竞争。然而，我们运行在 2 核 4GB 的虚拟机上，且拥有一个相对庞大的数据库（约 40 万条帖子，数据库大小 6GB），因此没有空间再增加大量每个占用 500MB 内存的 Unicorn 进程。我怀疑，如果我们将图像移至对象存储，由于对 Unicorn 工作进程的竞争减少，整体影响会变小；但鉴于我们目前仅在有两名用户在线时就观察到了这种影响，即使稍有变化，影响可能仍然显著。

更新：将速率限制的 `flood` 区域从 12r/s 调整为 36r/s，`burst` 从 12 调整为 36，至少减轻了“谁在线”插件带来的影响。我们正在测试此配置。

进一步更新：在将 `flood` 速率提高三倍后，目前我们未收到任何故障报告。

我使用了[外部 nginx](https://meta.discourse.org/t/create-a-unified-offline-maintenance-status-page-utility-for-discourse/135605)， ~~并基于速率限制模板，将速率限制应用到了外部 nginx~~ ，但实际上是在内部 nginx 中实施速率限制。这是因为外部 nginx 无法识别哪些路由是静态的，因此会对静态路由和动态路由都应用速率限制，这在我尝试时导致了加载静态资源时出现大量失败和重试。请注意，这也是运行外部 nginx 的一个理由；否则，我认为所有 IPv6 流量都会被归因于 Docker IP 地址，并像单一 IP 地址那样受到速率限制。

---

_[View the full topic](https://meta.discourse.org/t/benefits-of-the-whos-online-plugin/165583)._
