3 ms·
I don’t understand. If you provision the system with enough RAM, then you can for every page in RAM, hot or not.
by adastra22 1y ago
I don’t understand. If you provision the system with enough RAM, then you can for every page in RAM, hot or not.
- akvadrako 1y agoOnly if you have more RAM than disk space, which is wasteful for many applications.
- adastra22 1y agoRunning out of memory kills performance. It is better to kill the VM and restart it so that any active VM remains low latency. That is my interpretation of what people are saying upthread, at least. To which posters such as yourself are saying “you still need swap.” Why?
- eru 1y agoRAM costs money, disk space costs less money. It's a bit wasteful to provision your computers so that all the cold data lives in expensive RAM.
- adastra22 1y agoWhen building distributed systems, service degradation means you’ll have to provision more systems. Cheaper to provision fewer systems with more RAM.
- eru 1y agoIt depends on what you are doing, and how your system behaves. If you size your RAM and swap right, you get no service degradation, but still get away with using less RAM. But when I was at Google (about a decade ago), they followed exactly the philosophy you were outlining and disabled swap.
- fluoridation 1y ago>It's a bit wasteful to provision your computers so that all the cold data lives in expensive RAM. But that's a job applications are already doing. They put data that's being actively worked on in RAM they leave all the rest in storage. Why would you need swap once you can already fit the entire working set in RAM?
- eru 1y agoSure, some applications are written to manually do a job that your kernel can already do for you. In that case, and if you are only running these applications, the need for swap is much less.
- fluoridation 1y agoYou mean to tell me most applications you've ever used read the entire file system, loading every file into memory, and rely on the OS to move the unused stuff to swap?
- eru 1y agoNo? What makes you think so?
- fluoridation 1y agoThen what do you mean, some applications organize hot and cold data in RAM and storage respectively? Just about every application does it.
- eru 1y agoA silly but realistic example: lots of applications leak a bit of memory here and there. Almost by definition, that leaked memory is never accessed again, so it's very cold. But the applications don't put this on disk by themselves. (If the app's developers knew about which specific bit is leaking, they'd rather fix the leak then write it to disk.)
- KaiserPro 1y ago> Running out of memory kills performance. It is better to kill the VM and restart it so that any active VM remains low latency. Right, you seem to be not understanding what I'm getting at. Memory exhaustion is bad, regardless of swap or not. Swap gets you a better performing machine because you can swap out shit to disk and use that ram for vfs cache. the whole "low latency" and "I want my VM to die quicker" is tacitly saying that you haven't right sized your instances, your programme is shit, and you don't have decent monitoring. Like if you're hovering on 90% ram used, then your machine is too small, unless you have decent bounds/cgroups to enforce memory limits.