←back to thread

150 points shaunpud | 4 comments | | HN request time: 0s | source
Show context
nrdvana ◴[] No.45060203[source]
The third mitigating feature the article forgot to mention is that tmpfs can get paged out to the swap partition. If you drop a large file there and forget it, it will all end up in the swap partition if applications are demanding more memory.
replies(3): >>45060224 #>>45060756 #>>45061403 #
buckle8017 ◴[] No.45060224[source]
Which is a great reason to have a big swap file now.
replies(2): >>45060524 #>>45060578 #
gnyman ◴[] No.45060524[source]
Note though that if you don't have swap now, and enable it, you introduce the risk of thrashing [1]

If you have swap already it doesn't matter, but I've encountered enough thrashing that I now disable swap on almost all servers I work with.

It's rare but when it happens the server usually becomes completely unresponsive, so you have to hard reset it. I'd rather that the application trying to use too much memory is killed by the oom manager and I can ssh in and fix that.

[1] https://docs.redhat.com/en/documentation/red_hat_enterprise_...

replies(4): >>45060599 #>>45060656 #>>45060800 #>>45061646 #
1. baq ◴[] No.45060599{3}[source]
This is why I’m running with overcommit 2 and a different ratio per server purpose.

…though I’m not sure why we have to think about this in 2025 at all.

replies(1): >>45060864 #
2. worthless-trash ◴[] No.45060864[source]
I'm assuming that you monitor the service closely for OOM then adjust with demand ?
replies(1): >>45061818 #
3. baq ◴[] No.45061818[source]
yeah pretty much, also configuring memory limits everywhere where apps allow it. some software also handles malloc failures relatively gracefully, which helps a whole lot (thank you postgres devs)
replies(1): >>45080968 #
4. worthless-trash ◴[] No.45080968{3}[source]
Ive spent the last day thinking about that, I really can't see any big negative side effects, the only issue that I'd have is being notified of OOM conditions, and that would just be a syslog regex match. Great plan.