# Redis 使用内存限制为 1024MB 吗？

**URL:** <https://meta.discourse.org/t/redis-used-memory-limited-to-1024mb/336676>\
**Category:** Support\
**Created:** [2024年十一月18日 07:07 UTC](https://meta.discourse.org/t/redis-used-memory-limited-to-1024mb/336676 "2024-11-18T07:07:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![markersocial](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/markersocial/32/170136_2.png) [@markersocial](https://meta.discourse.org/u/markersocial)\
**Post date:** [2024年十一月18日 07:07 UTC](https://meta.discourse.org/t/redis-used-memory-limited-to-1024mb/336676/1 "2024-11-18T07:07:20Z")

</div>

看起来 Redis 的使用量似乎被限制在 1024mb 以上了？

我注意到，一旦 Sidekiq 仪表板中的内存使用量（MB RSS）超过该值，我就会开始收到类似以下的日志：

```plaintext
您的 Redis 网络连接性能极差。上次的 RTT 读数是 [96585, 101554, 97189, 99769, 94618]，理想情况下应该小于 1000。请确保 Redis 运行在同一可用区或数据中心

```

当我使用以下命令检查时：  
`./launcher enter app`  
`redis-cli info memory`

这是结果：

```plaintext
# Memory
used_memory:1072837696
used_memory_human:1023.14M
used_memory_rss:484577280
used_memory_rss_human:462.13M
..
maxmemory:0
maxmemory_human:0B

```

我在 app.yml 中设置了：  
`UNICORN_SIDEKIQ_MAX_RSS: 8000`

在 Sidekiq 仪表板中，RSS 使用量为 4,553 MB，利用率为 100%。这是在使用 2 个 UNICORN\_SIDEKIQ，并且 DISCOURSE\_SIDEKIQ\_WORKERS 未设置（因此默认为 5）。

我原以为 UNICORN\_SIDEKIQ\_MAX\_RSS 会允许 redis 使用更多内存？我有点迷茫，任何指导都将不胜感激！💌

这是在使用 Discourse 3.3.2 Stable 版本。

---

<div class="post-metadata">

**Author:** ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
**Post date:** [2025年四月4日 05:26 UTC](https://meta.discourse.org/t/redis-used-memory-limited-to-1024mb/336676/5 "2025-04-04T05:26:27Z")

</div>

Redis 只会使用它所需的内存，RTT 错误与之无关，它们更可能来自安装位置较远或机器没有足够资源来运行 Redis。

---

<div class="post-metadata">

**Author:** ![markersocial](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/markersocial/32/170136_2.png) [@markersocial](https://meta.discourse.org/u/markersocial)\
**Post date:** [2026年二月16日 07:01 UTC](https://meta.discourse.org/t/redis-used-memory-limited-to-1024mb/336676/6 "2026-02-16T07:01:19Z")

</div>

谢谢！我认为 RTT 问题是因为 THP 仍然启用，而我之前认为它已禁用：[MKJ's Opinionated Discourse Deployment Configuration - #34 by markersocial](https://meta.discourse.org/t/mkjs-opinionated-discourse-deployment-configuration/193355/34?u=markersocial)
