Failed to upgrade discourse instance to Feb 15 2022

I think it’s more than that - let me try to explain. The recommendation comes from redis, and redis recommends it because forking a process demands a lot of virtual memory, and redis forks to do background saves, and yet the virtual memory claimed is never going to be needed.

This is typical for many unix applications: they will fork, but will not need to double their memory usage. Because it’s typical for many, and because this is a kernel setting which changes the behaviour for all processes in all containers, it may well convert a failure into a success when virtual memory is under pressure.

On the small cheap instances which many of us use, virtual memory is often under pressure. And especially so during upgrades or rebuilds.

So changing this setting might well relate to whether an upgrade succeeds or fails, especially if there’s recently been a change which increases the demand on virtual memory.

As-shipped, the kernel will reject allocations which it can’t satisfy. With this tweak, it will accept those allocations, and failure might be averted, or it might happen later when the allocation becomes usage.

If your total of RAM and swap is big enough, you’ll never need to change this setting. If your total is not big, changing it might help.

2 Likes