Overcommit memory configuration

AI-generated summary

peternlewis reported resolving a CLI update issue via ./launcher rebuild app but questioned two warnings encountered during the process: a Redis memory overcommit warning and an awk error regarding a missing SSH key file. Ed_S clarified that the memory overcommit warning is significant and must be addressed by modifying the host’s kernel configuration (vm.overcommit_memory = 1) to ensure Redis background saves and replication do not fail. They recommended checking persistent settings with cat /proc/sys/vm/overcommit_memory and referenced MKJ’s Opinionated Discourse Deployment Configuration for guidance. The awk error regarding /root/.ssh/authorized_keys was not explicitly addressed but appeared to be a benign build system message.

peternlewis then discussed the complexities of disabling transparent_hugepage, noting difficulties in doing so permanently on Digital Ocean droplets due to lack of GRUB control and init script ordering issues. They found an older topic suggesting these warnings could be ignored, leaving them unsure if the configuration change was necessary.

Ed_S clarified that transparent_hugepage affects only performance, not stability. While the opinionated guide recommends tweaking it, older advice suggesting it can be ignored remains relevant for many users. In contrast, the memory overcommit setting is critical for reliability and should be fixed.

OK, cli update via ./launcher rebuild app resolved the issue.

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]

Two things I saw in the update were:

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

Do I need to follow up on either of these on another topic, or are they just the normal random messages that build systems send out that sound like errors but aren’t really?

The first of those is worth fixing: it’s a change to the kernel config, in effect, so it needs to be made in the host, as the container can’t do anything about it. See perhaps MKJ’s Opinionated Discourse Deployment Configuration. The exact change you need to make depends on which distribution you use, but you can see if you’ve succeeded with

# cat /proc/sys/vm/overcommit_memory
1

You want your change to be persistent over a reboot.

OK, I went down the rabbit hole of trying to set transparent_hugepage to disabled. It’s very complicated since to set it permanently it needs to be set in the kernel GRUB settings, but in Digital Ocean droplets you can’t control that, so then it has to be done in an init, but that only works if the init happens before the startup of Discourse, so there are ordering issues.

And then I figured someone here must have figured it out, cuz I’m sure I’m not the only one on Digital Ocean, and then I found this topic:

(admittedly from 2020 so something might have changed), which says you can ignore those warnings.

So that leaves me perplexed about how to do it, and whether I should do it.

This one affects only performance. I’ve tweaked it and the opinionated guide suggests you tweak it but yes that old post suggests you need not.