# Whole machine hangs during upgrade

**URL:** https://meta.discourse.org/t/whole-machine-hangs-during-upgrade/293592
**Category:** Self-hosting
**Tags:** server-resources
**Created:** [January 31, 2024, 6:21am UTC](https://meta.discourse.org/t/whole-machine-hangs-during-upgrade/293592 "2024-01-31T06:21:15Z")
**Posts on this page:** 1
**Showing post:** 12

<div class="post-metadata">

### Author: ![Ed\_S](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ed_s/32/134015_2.png) [@Ed\_S](https://meta.discourse.org/u/Ed_S)
#### Post date: [February 1, 2024, 10:15pm UTC](https://meta.discourse.org/t/whole-machine-hangs-during-upgrade/293592/12 "2024-02-01T22:15:10Z")

</div>

> [@Jagster](#):
>
> This is a bit off topic, but I really would like to understand. Why swap, that used 200 MB, helped when there was 2 GB free RAM?

I think the original problem was probably a process getting killed because the machine was out of memory (beware the OOM killer). Adding swap meant that memory was not exhausted. Those two outputs of free may not be telling the whole story, unless they were very carefully taken at the moment of most machine stress. It’s the peak swap usage that’s interesting, I think.

But there’s also the question of the kernel tunable as mentioned in  
[MKJ’s Opinionated Discourse Deployment Configuration](https://meta.discourse.org/t/mkjs-opinionated-discourse-deployment-configuration/193355)  
which I’ve got set correctly, but which maybe lots of people don’t have set correctly.

> [@MKJ's Opinionated Discourse Deployment Configuration](https://meta.discourse.org/t/mkjs-opinionated-discourse-deployment-configuration/193355/1):
>
> ## Kernel configuration
> 
> Redis (one of the key components on which Discourse is built) strongly recommends disabling transparent huge pages, and I also allow memory overcommit.
> 
> ```plaintext
> echo 'sys.kernel.mm.transparent_hugepage.enabled=never' > /etc/sysctl.d/10-huge-pages.conf
> echo 'vm.overcommit_memory=1' > /etc/sysctl.d/90-vm_overcommit_memory.conf
> sysctl --system
> 
> ```

Worth nothing that the memory overcommit has nothing much to do with Redis. It’s just that Redis is kind enough to hint that it should be set correctly.

---

_[View the full topic](https://meta.discourse.org/t/whole-machine-hangs-during-upgrade/293592)._
