Hacker News new | ask | show | jobs
by KaiserPro 745 days ago
Given that the author works at a large company, that has millions of machines, and where any swap change has cost implications in the tens of millions pounds, I suspect the article is based on data, rather than vibes.

Swap is less critical now, and given that k8s has some pathological dislike of it (again I suspect based on vibes) I can see why people dont have it.

However when you are using close to 70% of your total ram, swap improves performance significantly. Also where I work, it also stop the OOM from killing my repo VFS layer when I'm compiling something.

> The core problem with swap is that nowadays you need gigabytes of swap to actually make a difference

It was always the case. but then a TB of disk isn't that expensive anymore.

1 comments

> Given that the author works at a large company, that has millions of machines, and where any swap change has cost implications in the tens of millions pounds, I suspect the article is based on data, rather than vibes.

Yes, but the author is most likely optimizing for a metric that I don't care so much in my per personal computer while dismissing metrics that I care about.

> It was always the case. but then a TB of disk isn't that expensive anymore.

But swapping out GB of RAM is expensive in terms of latency.

but its rarely gb at the same time. Thats the point. Its a dumping ground for stuff thats not used very often. meaning that you can have a bigger VFS cache, which reduces latency
> but its rarely gb at the same time. Thats the point. Its a dumping ground for stuff thats not used very often.

But it has to be GB to actually make a difference. If your swap is not full of GB of data, then obviously you don't need it (or it just becomes a reserve when you are in an OOM situation - but this is where you don't want to be with swap avaible either)

> > but its rarely gb at the same time. Thats the point. Its a dumping ground for stuff thats not used very often.

> But it has to be GB to actually make a difference. If your swap is not full of GB of data, then obviously you don't need it (or it just becomes a reserve when you are in an OOM situation - but this is where you don't want to be with swap avaible either)

I think the parent meant, that it barely needs to be read / write GBs at the same time. Not that that much swap is never being in use at the same time.

So you can use a lot of swap, but will never need to read it back in all at once.

indeed, thank you for explaining it clearer than me!