4 ms·
You guys are totally talking past each other. Varnish makes the assumption that the OS cache replacement policy is awesome. You should let it do its thing and
by wrs 16y ago
You guys are totally talking past each other.
Varnish makes the assumption that the OS cache replacement policy is awesome. You should let it do its thing and write your data structures accordingly. Considering that the author is intimately familiar with that policy, it's a valid approach.
You could alternately say that you don't want to depend on the OS policy, which you don't control. You could say that using a differently-packed heap layout is more important than retaining 8MB more page content in the cache. (Maybe you have a nice fully-debugged heap library handy and you don't want to throw it away to get that 8MB back.) In that case, wiring that 8MB into physical memory is a valid approach.
Databases (and, indeed, OS kernels) override generic cache replacement policies like this all the time.
What is not a valid approach ("doing it wrong") is not thinking through issues like this at all, ignoring the dominating runtime cost of the memory hierarchy.
- jrockway 16y agoYou guys are totally talking past each other. Not totally, it started with "the article is dumb", to which someone replied "nuh uh! you're dumb", to which the OP replied, "oh no i'm not", to which another reply said "oh yes you are". Very focused. (The rest of the posts were good reading, but getting the emotion involved just makes everyone mad. Neither of the commenters cared anymore about their argument, they only cared about winning.) At least on 4chan we get pictures of cats with this stuff ;)
- jemfinch 16y ago> The rest of the posts were good reading, but getting the emotion involved just makes everyone mad. For my part, there was no emotion involved. That's why I didn't bother replying to the emotional aspects of timr's second post. > Neither of the commenters cared anymore about their argument, they only cared about winning. I care a lot about the argument; I think Poul's article was interesting and relevant, and should not be dismissed by people who (it seems clearly to be the case) did not understand it, but think they did.
- jemfinch 16y ago> You guys are totally talking past each other. That doesn't change the fact that, as best I can discern, the OP has made some factual errors which demand (<http://xkcd.com/386/> http://xkcd.com/386/>) response.
- ErrantX 16y agoYou realize that the XKCD example is a warning for those in your position not timr's :) (I have it hung on the wall in my office for this very reason)
- timr 16y agoI'm not talking past anyone -- I'm just choosing to ignore the silly aspersions to my intelligence. It's possible to make an argument without calling the other guy stupid. What you're seeing here is really just the usual battle between ideology and reason that seems to pop up on HN on the weekends. We've got a fundamentally silly article that wants to take all of computer science to task, based on a corner-case analysis of worst-case performance of a single algorithm, in a single, exaggerated context. You're right that the author wants to rely entirely upon the OS cache replacement policy for Varnish and that's fine, as far as it goes. But this ideology leads directly to the problem observed (namely: some rarely used things that really should stay in memory are evicted, because the OS has no ability to discern the semantics of memory use by the application). Rather than acknowledging this limitation, the author has decided instead that the algorithms are all wrong, and that the Stoopid Computer Scientists are all a bunch of short-sighted eggheads. Again, it's not a question of who's right, and who's wrong -- it's a matter of philosophy. You can assume that the OS memory manager is the all-knowing, all-powerful Wizard of RAM, or you can give it some guidance. In this case, locking an 8MB heap into RAM is hardly a trade-off, when you're talking about a system that is actively managing several orders of magnitude more memory on a regular basis. Spending days of coding time optimizing a basic data structures for worst-case memory access patterns is short-sighted, when the alternative is an mlock() call.
- jemfinch 16y ago> I'm not talking past anyone -- I'm just choosing to ignore the silly aspersions to my intelligence. There haven't been any "silly aspersions" to your intelligence. You just didn't exhibit a sufficient knowledge of the problem to dismiss the article like you did. Computer science is a large field, and it doesn't say anything at all about your intelligence if you're unaware of one particular implementation of one particular type of software by one particular author. You're the one who's cast this whole conversation into a competition, not me. > It's possible to make an argument without calling the other guy stupid. Exactly, which is why I responded like I did, and gave you an opportunity to explain whether I misunderstood you. You, on the other hand, responded with sarcasm and rhetoric, and clarified nothing.