3 ms·
So why not address those edge cases with something like "madvise" style configuration rather than just saying application developers need to reinvent the wheel
by shawnz 4y ago
So why not address those edge cases with something like "madvise" style configuration rather than just saying application developers need to reinvent the wheel any time they do something outside the golden path?
- lazide 4y agoBecause that would require the programmer do something explicit to deal with a runtime edgecase they fundamentally don’t have the context to decide the right course of action on? Especially if it’s a library or the like? That infrequent call might be key for program stability in one context or pointless (garbage collector whatever- key in a major server program, pointless in a toy app). The moral of the story is, if under load code or data gets moved from where access is fast (RAM) to where it is slow ( even SSD and most NVMe counts here) then gets accessed when under load? It makes the problem much worse.
- shawnz 4y agoSurely if they don't have that context, then it's even less likely they'll be able to roll their own optimization to fix the issue without swap.
- lazide 4y agoWell, they could use less RAM in general (hence less likely to be applying memory pressure). But good luck. Hence why the advice for servers is turn swap off. It’s a footgun waiting to happen.
- menaerus 4y agoI don't understand the argument. Performance-wise, swap will obviously decrease the one but runtime-wise isn't it going to actually enable your application to continue running rather than crashing, albeit at much lower speeds? Once you exhaust the RAM and you run with no swap configured, what happens with your application?