Hacker News new | ask | show | jobs
by martin_andrino 3109 days ago
Swap isn’t needed at all in this age. It’s just there for people who can’t afford more RAM and therefore have to resort to hacky solutions like this.
4 comments

The article specifically lists reasons why you should enable swap when there is plenty of RAM. Can you elaborate on what part of the article's reasoning you disagree with?
> It’s just there for people who can’t afford more RAM

So I should throw away my 5-year-old notebook that's still working perfectly fine just because the RAM is soldered in? Doesn't sound like efficient resource usage (both money and rare earths).

Disk is still way cheaper than RAM, and I always add some swap space to my servers just to lessen the chance of getting ENOMEM errors if/when an unexpected or unusual workload would come along.
What an absurd statement.

Do you use a laptop? I do and I'm using swap space right now. I would like to buy a laptop with 32 or 64 Gigs of RAM but I can't as most(all?) laptop makers don't ship with a memory controller that permits more than 16 Gigs of RAM. And I can afford to buy more RAM.

What is the rule for setting swap size, or can I use just swap file just like on win/mac? (I heard it will disable hibernation then)
The basic rule is `RAM + 2GB`

I usually peak at 34GB, unless I have reason (like needing/wanting to enable full hibernation) to use 66GB, 130GB, etc.

what if if you increase your RAM after installing the system?
It's a circular argument that people get into because they have the incorrect kernel settings. Even if you have 4TB of ram, someone will say to add more memory on disk. It just means the system is not configured correctly. I have 30k servers and not a single one of them has swap.
>I have 30k servers and not a single one of them has swap.

Physical? VM? Cloud?

I've never seen an environment with more than a couple carefully-tuned machines that didn't run swap on every last one