5 ms·
Interesting that most voters on the page believes that zero swap is a good thing. Taking a quick look at my own servers and desktop usage it fits perfectly in t
by Dahoon 8y ago
Interesting that most voters on the page believes that zero swap is a good thing. Taking a quick look at my own servers and desktop usage it fits perfectly in table 2, ie. the same as the authors and Fedora's recommendation.
In what situation would you be 100 % sure you could never run out of RAM or would rather have an OOM situation than using swap? Seems extremely counter-intuitive to me.
- colejohnson66 8y agoI’m of the impression that those people are the same ones who would turn off the page file on Windows
- kim0 8y agoIt more like, I prefer to get out of memory error sometimes, rather than watch a slow death via tons of swapping
- kfwhp 8y agoWhen you get out of RAM, the computer becomes completely unusable for an unspecified amount of time and you end up force rebooting after minutes of frustration. I'd rather have the OOM killer step up and keep things in order.
- znpy 8y agoThe thing is that you don't get "out of memory errors" you get the kernel to almost randomly choose a process and sacrifice it in order to free ram. If the chosen process is a database... That's not funny. At all. Edit: you could adjust the oom score to avoid Linux killing important process, but I don't want to discover if Linux is actually going to follow the oom score or just "keep it in mind" when choosing a process to sacrifice.
- deleted 8y ago[deleted]
- arielweisberg 8y agoWhen you have 256 gigabytes of RAM 8 gigs of swap isn't going to move the needle on OOM and it will put you at risk of having things you didn't want swapped out swapped preemptively. At various points in history Linux would swap out your application in favor of cached filesystem data even with kernel tunables set appropriately. This may have changed, it may not, but who cares because swap just isn't that useful when you have a lot of RAM. Also swap on spinning disk is 100% pointless in most cases and many servers are still on spinning disk only as is appropriate for their usage. On a server running data intensive applications you generally have your memory divided pretty cleanly into scratch space and working set you absolutely don't want swapped out, and data on disk that is swapped out either via a buffer pool or the page cache. The application manages which category memory utilization falls into in order to ensure consistent performance and to avoid things like event loop threads blocking on swap or threads holding locks blocking on swap. Swap works great on desktops now that SSDs are a thing and it regularly cleans up after messy applications on my MacOS laptop. Compressed memory is also great. Granted performance on my Mac is abysmal, browser tabs take seconds to open and accept input, apps need to warm up after a context switch, but it beats opening and closing stuff constantly.
- beatgammit 8y agoBefore I got an SSD, I'd rather have the OOM handle it than risk swapping to disk. Now that I have an SSD, swapping isn't a big deal, but I also don't bother hibernating, so I just make sure I have a fair amount of swap (up to 8GB).