←back to thread

150 points shaunpud | 1 comments | | HN request time: 0.391s | 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 #
k_bx ◴[] No.45060656[source]
Disabling swap on servers is de-facto standard for serious deployments.

The swap story needs a serious upgrade. I think /tmp in memory is a great idea, but I also think that particular /tmp needs a swap support (ideally with compression, ZSWAP), but not the main system.

replies(3): >>45060682 #>>45062059 #>>45062962 #
ravetcofx ◴[] No.45060682[source]
Swap always seemed more meant for desktop use. Servers you need to give the real memory expected of the application stack.
replies(2): >>45060812 #>>45060866 #
1. someothherguyy ◴[] No.45060812[source]
plenty of footguns in that general advice, local in memory storage services with default config, etc