←back to thread

804 points jryio | 1 comments | | HN request time: 0.232s | source
Show context
speedgoose ◴[] No.45661785[source]
Looking at the htop screenshot, I notice the lack of swap. You may want to enable earlyoom, so your whole server doesn't go down when a service goes bananas. The Linux Kernel OOM killer is often a bit too late to trigger.

You can also enable zram to compress ram, so you can over-provision like the pros'. A lot of long-running software leaks memory that compresses pretty well.

Here is how I do it on my Hetzner bare-metal servers using Ansible: https://gist.github.com/fungiboletus/794a265cc186e79cd5eb2fe... It also works on VMs.

replies(15): >>45661833 #>>45662183 #>>45662569 #>>45662628 #>>45662841 #>>45662895 #>>45663091 #>>45664508 #>>45665044 #>>45665086 #>>45665226 #>>45666389 #>>45666833 #>>45673327 #>>45677907 #
1. 1vuio0pswjnm7 ◴[] No.45677907[source]
"You may want to enable earlyoom, so your whole server doesn't go down when a service goes bananas."

Another option is to run BSD to avoid the Linux oom issue

For example, I'm not using Hetzner but I run NetBSD entirely from memory (no disk, no swap) and it never "went down" when out of memory

Looks like some people install FreeBSD and OpenBSD on Hetzner

https://gist.github.com/c0m4r/142a0480de4258d5da94ce3a2380e8...

https://computingforgeeks.com/how-to-install-freebsd-on-hetz...

https://web.archive.org/web/20231211052837if_/https://www.ar...

https://community.hetzner.com/tutorials/freebsd-openzfs-via-...

https://www.souji-thenria.net/posts/openbsd_hetzner/

https://web.archive.org/web/20220814124443if_/https://blog.v...

https://www.blunix.com/blog/how-to-install-openbsd-on-hetzne...

https://gist.github.com/ctsrc/9a72bc9a0229496aab5e4d3745af0b...

If it is possible to boot Hetzner from a BSD install image using "Linux rescue mode"^1 then it should also possible to run NetBSD entirely from memory using custom kernel

Every user is different but this is how I prefer to run UNIX-like OS for personal, recreational use; I find it more resilient

1.

https://docs.hetzner.com/robot/dedicated-server/troubleshoot...

https://blog.tericcabrel.com/hetzner-rescue-mode-unlock-serv...

https://github.com/td512/rescue

https://gainanov.pro/eng-blog/linux/hetzner-rescue-mode/

https://docs.hetzner.com/cloud/servers/getting-started/rescu...

ChromeOS has an interesting approach to Linux oom issues. Not sure it has ever been discussed on HN

https://github.com/dct2012/chromeos-3.14/raw/chromeos-3.14/m...