过量提交内存配置

好的,通过 ./launcher rebuild app 更新 CLI 解决了问题。

root@forum-app:/var/www/discourse# cat /VERSION 
2.0.20261119
root@forum-app:/var/www/discourse# nginx -v
nginx version: nginx/1.26.3
root@forum-app:/var/www/discourse# ruby -v
ruby 4.0.10 (2026-11-19 revision a704b7cd95) +PRISM [x86_64-linux]

在更新过程中我注意到两点:

4474:C 22 Nov 2026 05:33:16.025 # WARNING Memory overcommit must be enabled! Without it, a background save or replication may fail under low memory condition. Being disabled, it can also cause failures without low memory condition, see https://github.com/jemalloc/jemalloc/issues/1328. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
awk: fatal: cannot open file `/root/.ssh/authorized_keys' for reading: No such file or directory

我需要在其他主题下跟进这两个问题吗?还是说这些只是构建系统发出的普通随机消息,听起来像错误但实际上并不是?

其中第一点值得修复:这实际上是内核配置的更改,因此必须在主机上进行,因为容器无法处理它。你可以参考 MKJ 的 Discourse 部署配置推荐。具体需要做的更改取决于你使用的发行版,但你可以通过以下命令检查是否成功:

# cat /proc/sys/vm/overcommit_memory
1

请确保你的更改在重启后仍然有效。

好吧,我深入研究了如何将 transparent_hugepage 设置为 disabled。这非常复杂,因为要永久设置它,需要在内核的 GRUB 配置中进行,但在 Digital Ocean 的 droplet 中无法控制这一点,因此必须在 init 阶段完成,但这只有在 init 在 Discourse 启动之前执行时才有效,所以存在顺序问题。

然后我想,这里一定有人已经解决了这个问题,因为我确信我不是唯一一个在 Digital Ocean 上遇到这种情况的人,于是找到了这个帖子:

(诚然,这是 2020 年的帖子,可能情况有所变化),其中提到可以忽略那些警告。

这让我对如何操作以及是否应该这样做感到困惑。

这项设置仅影响性能。我对它进行了调整,那些主观性较强的指南也建议进行调整,没错,那个旧帖子确实说明你不必这样做。