5 ms·
If anyone owns a blog or site that they suspect may appear on HackerNews (especially if you're posting it), then please take the small amount of time to put an
by buro9 14y ago
If anyone owns a blog or site that they suspect may appear on HackerNews (especially if you're posting it), then please take the small amount of time to put an instance of Varnish in front of the site.
Then, ensure that Varnish is actually caching every element of the page, and that you are seeing the cache being hit consistently.
You should expect over 10,000 unique visitors within 24 hours, with most coming in the 30 minutes to 2 hours after you've hit the front page on HN.
You need not do your whole site... but definitely ensure that the key landing page can take the strain.
Unless you've put something like Varnish in front of your web servers, there's a good chance your web server is going down, especially if your pages are quite dynamic and require any processing.
- deleted 14y ago[deleted]
- Cherian 14y agoCucumbertown co-founder here. Nginx was serving the cache and our sense was it was caching. But then the day before we put in csrf validation to the login form and it was bypassing the caching. So in theory we were positioned to serve from Nginx cache.
- gingerjoos 14y agoThe blog mentions that they did have caching on with nginx (which is what Varnish does, isn't it?). The problems were because of nginx not caching the frontpage (configuration issue) and because there was an unexpected hit on solr.
- danso 14y agoThe unexpected hit was just users using the full text search, right? That probably should have been one of the first things tested as I assume that would be a bottleneck in speed in all stages of development...or at least it has been in my experience. I often try to think of ways to not have full text search...this case is a little more difficult, but why not create a list of common recipe names (i.e. "grilled cheese" would be a facet for all grilled cheese sandwiches) and store it as a static json? It would take some taxonomy work on the backend but the list as JsON could easily be less than a MB and the. You wouldn't have to worry about full search as much...full search could still be an option, just not a top of the front page option.
- Cherian 14y agoAgree, this was the Achilles heel. It was total blunder not testing full text. In our defense this page was supposed to be HTTP cached and that didn’t happen which led to this domino effect.
- ChrisNorstrom 14y agoOh, Well then let me share this. A few weeks ago I got on the front page and within a 24 hour period was hit with 29,000 unique visitors with 38,000 page views. The page itself is image heavy with 1.3 MB on first load. I'm running Wordpress with the Quick Cache plugin by PriMoThemes. I'm hosted on a shared 1and1 server. I've been hit before and went down, that's when I installed the Quick Cache plugin. Also 1and1 moved me to another server at some point but I'm not sure if it was before or after. Either the cache plugin is really good or I'm on a rockin server all by my lonesome. Or both. If you're self hosting a wordpress site grab the Hyper Cache plugin or the very very simple Quick Cache plugin by PriMoThemes. http://www.tutorial9.net/tutorials/web-tutorials/wordpress-caching-whats-the-best-caching-plugin/ http://www.tutorial9.net/tutorials/web-tutorials/wordpress-c...
- px1999 14y agoThank you. This is pretty much exactly what I read the post for and was a little disappointed not to find. People talk about getting frontpaged on HN, Slashdot or Reddit, and how you need to be sure you can handle the load, but never give any useful figures on what that load is. Knowing that I can serve 10 requests per second and likely withstand a frontpage on HN is more useful to me than knowing that I need a way out if and when my web-servers are being totally overwhelmed.
- ISL 14y agoOn an unexpected trip onto the front page, here's what I saw (hits at ~1 Hz on a Friday evening in the top slot): http://measuredmass.wordpress.com/2012/10/12/hacker-news/ http://measuredmass.wordpress.com/2012/10/12/hacker-news/ Graphical post-mortem here: http://measuredmass.wordpress.com/2012/10/20/more-hn-numbers/ http://measuredmass.wordpress.com/2012/10/20/more-hn-numbers...
- autoreverse 14y agoWP Super Cache (using the htaccess option) got a client's site through 56,000 uniques / 78,000 page views on a HostGator VPS with 1.3GB RAM. The site unexpectedly got picked up by Japanese blogs as it was being taken live. Google Analytics showed up to 400 active visitors. Fun times. AwStats screen shot: https://unavailable.s3.amazonaws.com/20121130_WP-Super-Cache-AWSTATS.jpg https://unavailable.s3.amazonaws.com/20121130_WP-Super-Cache...
- jjoe 14y agoI'll be very happy to help you and HN'ers set Varnish up on their server (not looking for compensation for this) and get you through HN traffic on your launch day. Plug: we've built several products around Varnish so we have a good handle of how/where Varnish can be leveraged. Here's a list of varnish things we've built at unixy: Varnish load balancer: http://www.unixy.net/advanced-hosting/varnish-load-balancer http://www.unixy.net/advanced-hosting/varnish-load-balancer Varnish for cPanel and DirectAdmin: http://www.unixy.net/varnish http://www.unixy.net/varnish Varnish w/ Nginx for cPanel: http://www.unixy.net/advanced-hosting/varnish-nginx-cpanel http://www.unixy.net/advanced-hosting/varnish-nginx-cpanel Email in profile. I'll be more than happy to help out. Joe
- dhimes 14y agoA how-to guide would be really really cool.
- jjoe 14y agoVarnish is very much like a programmable device. A VCL that works for one website can break the other. So it's important to know what you're up against in order to cook up the right VCL. You could come up with a generic VCL that works for most websites out there but its cache effectiveness diminishes as you try to account for the most common corner cases. In fact, we did come up with such VCL. We distribute it with the cPanel Varnish plugin. If you ever have a question or need a hand with Varnish/VCL drop me an email. I'll be more than happy to help out.