5 ms·
Making Posterous faster with Varnish page caching
- js4all 16y agoInteresting, we also added a Varnish based cache layer and also got a dramatic performance boost. The connections to the backend dropped to 50%, taking off a lot load. I am currently going through your VCL to take some ideas for improvement. Thanks for posting that.
- yish 16y agoAny opinions on pros/cons of using Varnish vs a CDN (Akamai/Limelight)
- mrkurt 16y agoI really love Varnish, but hate VCL. I wish they'd have embedded Lua or something. There's all sorts of cool stuff you could do with better scripting.
- papaf 16y agoI think the unique point about VCL is that it compiles down to machine code. Varnish makes a big thing about doing things the fastest way possible.
- apgwoz 16y agoI didn't realize this for some reason, makes it a bit more obvious as to why you can actually embed C. /slaps forehead
- jacquesm 16y agoVCL is actually one of the strong points of varnish, if you have a more complex situation you can pull all kinds of tricks without slowing down.
- seregine 16y agoNice choice. This post about Varnish architecture is one of my favorites: http://www.varnish-cache.org/trac/wiki/ArchitectNotes http://www.varnish-cache.org/trac/wiki/ArchitectNotes
- mahmud 16y ago"The Varnish Guy", as many call him here and on reddit is none other than Poul-Henning Kamp, Yeah, that phk from FreeBSD. So, yeah, you're gonna get some top-notch systems engineering from him.
- trevorturk 16y agoVarnish is most definitely a huge win. It can be somewhat of a pain to install if you're not using Chef or something, though. Here's some helpful info I compiled that might come in handy for first-timers: Installing Varnish with nginx, Passenger, and Monit on Ubuntu 8.10 intrepid: http://trevorturk.com/2009/10/22/installing-varnish-with-nginx-passenger-and-monit-on-ubuntu-8-10-intrepid/ http://trevorturk.com/2009/10/22/installing-varnish-with-ngi... It's a bit out of date now, but basically still applicable. Also, here are some packages for Sprinkle, which is an alternative to Chef that I like: http://github.com/trevorturk/sprinkle-packages http://github.com/trevorturk/sprinkle-packages Varnish is not installed by the default example, but look in packages/varnish.rb and you'll be able to sort it out. Go go gadget Varnish!
- nostromo 16y agoPushing dynamic content via AJAX and caching the much larger part of the page that isn't dynamic is a great tip -- much better than caching fragments. I will now steal it and appear smart by telling others. :-P
- davcro 16y agoI also like to cache resources as JSON and then render them into a template with Ajax.
- patio11 16y agoMake sure you run your specific implementation past an SEO who knows what they're doing -- and on this issue, most don't. (The sweet spot is probably caching the whole page for non logged-in users and regenerating that "relatively infrequently", and doing the AJAX trick for your logged-in users only.)
- deleted 16y ago[deleted]
- amix 16y agoSlightly off-topic: Varnish has some really beautiful C code. It's so good you can get the source code in book form. Check out: http://ing.dk/modules/xphoto/cache/40/31740_460_400.jpg http://ing.dk/modules/xphoto/cache/40/31740_460_400.jpg http://phk.freebsd.dk/misc/_book2.pdf http://phk.freebsd.dk/misc/_book2.pdf ;)
- jacquesm 16y agoIt's a textbook example of how to code up a unix daemon that does a spectacular amount of work.
- herf 16y agoTheir description of Lacquer sounds problematic to me. The usual failure case for this is that a cache node goes down for awhile, misses some invalidation messages, then comes up and starts serving (stale) traffic again. This case isn't so bad if you keep your TTL low, and have cheap page revalidation.
- rantfoil 16y agoIdeally invalidation happens on an offline queue with retry support. Server down? Reschedule job and retry later. We use Delayed Job at Posterous for things like this. Resque works too.
- blantonl 16y agoVarnish is very attractive, and it is something that my organization is beginning to look at. But, this appears to be a new blog from Posterous, with this submission being it's first post, and it comes to HN just after Posterous had some, well potentially negative press about their traffic. Am I off base in asserting that this blog post is a marketing play? And if this isn't their first blog post, please let me know of my grave error (and down-vote me accordingly) Edit and follow-up: This blog has been around for a while, so I guess I'll sit back and relax. However, I'll still stand behind the marketing assertion.
- natrius 16y agoCorporate blogs exist solely for marketing purposes. There's nothing wrong with that.
- jacquesm 16y agoHappy to see varnish get so much airtime recently, it's a great piece of software and I would not be able to run my service at the current budget without it. If you are not a varnish user yet and you have a high volume site, go check it out, and save yourself some big $ by better utilizing the servers that you already have.
- datums 16y agoGetting -> 502 Bad Gateway