Re:In defence of swap: common misconceptions
by cesaref on Tuesday June 09, 2020 @04:24AM
(#23464804)
Agreed, if you can size it, you can specify the right memory for a host for an app. There are plenty of situations where you've got dedicated hardware and a suitable budget and you can do size the hardware correctly.
If however you have something like kubernetes, your apps move across hosts, you have memory scaling with use (e.g connections) and you have no idea what the load on the app will be, it becomes basically impossible to right-size the memory so other strategies come into play. Monitoring becomes king at that point.
Re:In defence of swap: common misconceptions
by throwaway2048 on Tuesday June 09, 2020 @04:56AM
(#23464964)
If your workload cant fit in memory, without special measures such as optane swap storage you will have such crushing unresponsiveness even with something like SSDs that it is entirely not worth the hassle in 99% of cases, no matter what your budget is.
Re:In defence of swap: common misconceptions
by clarry on Tuesday June 09, 2020 @04:31AM
(#23464851)
And if you can't size it, you can't size swap either so yeah.. monitor and then do what you need to do.
Re:In defence of swap: common misconceptions
by de_watcher on Tuesday June 09, 2020 @07:28AM
(#23465620)
Swap is purely psychological. It's like a slower RAM that stops you so you can think about what you've done without actually losing your work.
Re:In defence of swap: common misconceptions
by otabdeveloper4 on Tuesday June 09, 2020 @05:55AM
(#23465203)
> ...unless you want to prepare for emergency.
On a modern desktop system 'emergency' is every day, thanks to modern Javascript and the modern web.
If you can honestly answer "How much swap do I need, then?", and the answer is not infinite, then you can just add that amount of RAM instead of swap and be done with it, no need for swap, unless you want to prepare for emergency.
"Ideally you should have enough swap to make your system operate optimally at normal and peak (memory) load." Ideally you should have enough memory to make your system operate optimally at normal and peak memory load. In a perfect world, everything would fit in CPU's SRAM and you wouldn't even need DRAM..