←back to thread

804 points jryio | 1 comments | | HN request time: 0.206s | 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 #
cactusplant7374 ◴[] No.45661833[source]
What's the performance hit from compressing ram?
replies(4): >>45661888 #>>45661893 #>>45662040 #>>45662060 #
speedgoose ◴[] No.45661888[source]
I haven’t scientifically measured, but you don’t compress the whole ram. It is more about reserving a part of the ram to have very fast swap.

For an algorithm using the whole memory, that’s a terrible idea.

replies(2): >>45661932 #>>45664998 #
1. LargoLasskhyfv ◴[] No.45664998[source]
>...but you don’t compress the whole ram.

I do: https://postimg.cc/G8Gcp3zb (casualmeasurement.png)