If you're hosting some sort of blog post, the best way to ensure that all goes well with high traffic is to make it static. Something like jekyll works great for this (publishing especially), and you can host any static site with a node server in like 3 lines of code on nodejitsu for $3/month.<p>Nodejitsu can handle hacker news traffic without even the slightest blink, with one dyno - I had a post up on the homepage for hours with over 200 concurrent visitors and like 13,000 total for the day and never had a single issue. Again, $3/month for that.<p>No need to over-complicate things : )
I'm constantly amazed at how poorly Wordpress is able to perform. 2.5GB virtual server with a cache in front of it and it went down?<p>My blog is a Django app running on a 512MB Rackspace VM with a basic Apache, mod_wsgi, and Postgres setup. I have a dozen low traffic applications all running on the same server alongside it. I have zero caching set up so every hit is doing the full process of querying the database and pushing the results out through a template.<p>I was on the front page of HN last year and the server load was negligable. I have graphs: <a href="http://thraxil.org/users/anders/posts/2012/06/02/How-Django-deals-with-a-Hacker-News-frontpaging/" rel="nofollow">http://thraxil.org/users/anders/posts/2012/06/02/How-Django-...</a>
Mostly as an educational exercise (perhaps in futility) I decided to try writing my own small php framework specifically to build and serve static files, load external libraries only when necessary and automatically send caching headers. The point being, for instance, not to even load Dwoo except if compiling the static pages (as opposed to fetching data from a view, building them and serving them with each request.)<p>Now i'm wondering if i'm not both overoptimizing and missing the point entirely.<p>And yes I do realize 'custom php framework' is missing the point of frameworks and that php is an abomination. Getting Laravel to do what I wanted (awesome as it is, and it is) started to seem like trying to tweak a cannon into a flyswatter.<p>It's still fun, but I dread it ever getting posted here. Assuming it gets finished.
NginX + php-fpm + APC did the trick for me, at one time even in an EC2 Micro instance under heavy load.<p>There is a very nice hack I applied to my WordPress installs, but it's not for the faint hearted: hack the WP index.php to serve pages directly from Memcache for all non-authenticated GET requests. The beauty of this is that for most requests, the WP environment (which is horribly bloated) does not even get loaded.<p>It works about an order of magnitude better than all those cache plugins, but the downside is of course that software updates require some special care.
First time I reached the front page I had ~250 concurrent users and increasing, then the server crashed.<p>After that I wrote a cronjob that runs a script which automatically increases my virtual machines RAM. When I have little or no visits it uses 1GB RAM the most it went up to was 9GB RAM (increasing with 1GB at a time).<p>It also sends me an e-mail when increasing/decreasing the RAM so I can ensure that it doesn't crash.<p>I also use Wordpress with caching enabled and the above helps me keep the costs down, don't want the server to run on 8GB RAM all the time nor 1GB RAM.
My blog (elweb.co) has been on the HN home page a few times. I use Wordpress with WP Super Cache, hosted on cheapest available shared plan from Dreamhost with no problems.
We had a blog article on the front page of HN recently ( <a href="https://news.ycombinator.com/item?id=5133906" rel="nofollow">https://news.ycombinator.com/item?id=5133906</a> ) and I can’t say we had much trouble. Pushed the Heroku dynos up to two for an evening then dropped them back down to one at the end of the day. The site assets are hosted on S3 and we didn’t have to touch that. Ended up with about 16k hits.
We recently launched a simple website monitoring app for the iPhone where we ping sites from our servers, and send push notifications when we detect something is wrong (a poor man's pagerduty or pingdom where you do everything from your phone and can subscribe using IAP).<p>Probably the biggest lesson we've learned from collecting data on latency and timeouts from our backend is that there are a LOT of very poor hosts out there. Trying to strike a balance between intermittent failures, and actual "Your site is down, you need to do something" is pretty difficult, unless you are willing to simply wait long enough. We'll regularly see timeouts from places like Tumblr and Github Pages--they never go down, but things can get spotty. We can also tell when certain hosting providers are doing their weekly backups (or something - just guessing) because things will just go to pot at the same time every weekend for about an hour.<p>I can second the S3/CloudFront recommendation. Pretty rock solid (modulo downtime in specific regions).<p>For anyone curious about the app:
<a href="http://vigil-app.com" rel="nofollow">http://vigil-app.com</a>
I've read so many times on HN that people find it hard to scale WordPress. Really? Running WordPress on 128MB VPS and theoretically I can handle more than 250 request per second without problem[1]. Granted that number is just theoretical value but please, if you have gigabytes of RAM and your WordPress site fail after some hundreds of request per second, you certainly have done something terribly wrong. Especially for site with text and very few media content.<p>Forget any other setup you've ever used, go with this for high performance WordPress<p>1) Nginx [set so that request to static content to completely bypass PHP]<p>2) PHP-FPM<p>3) APC [Object & Database cache]<p>4) W3 Total Cache or WP Super Cache<p>5) Varnish<p>There many other high performance WordPress setup you could find out there but in term of simplicity and manageability, this is the one I fancy most. The bottleneck in this setup is RAM, not PHP, WordPress or MySQL read/write operation as I've seen in many server setup.<p>Disclaimer : I run small operation of managed WordPress hosting called KittySensei[2]<p>[1] <a href="http://i.imgur.com/m0Dg9YR.png" rel="nofollow">http://i.imgur.com/m0Dg9YR.png</a><p>[2] <a href="http://www.kittysensei.com" rel="nofollow">http://www.kittysensei.com</a>
Good tips for Wordpress users. Another great option we went for is hosting your entire site/blog on S3/cloudfront. This can be done using tools like Jekyll (<a href="https://github.com/mojombo/jekyll" rel="nofollow">https://github.com/mojombo/jekyll</a>) or Middleman (<a href="http://middlemanapp.com/" rel="nofollow">http://middlemanapp.com/</a>).
If you are self hosting Wordpress, the w3 Super Cache plugin is solid:
<a href="http://wordpress.org/extend/plugins/w3-total-cache/" rel="nofollow">http://wordpress.org/extend/plugins/w3-total-cache/</a><p>My otherwise poorly maintained blog didn't have a problem with a simultaneous HN/Slashdot hit, and I'm not even sure I'm using all the settings correctly. But the basic page cache seems to do what it promises.<p>Edit: oops, I see the OP is using Super Cache as well but still flopped. Then he is definitely doing someone wrong. My blog is hosted on the cheapest hosting plan that Dreamhost allows.
My solution was to move my WP blog from being hosted locally to Github pages using Jekyll. They'll do a much better job keeping it up than I will and more importantly it's less for me to worry about.
I wrote about my experience related to this in detail -
Post mortem of a failed HackerNews launch [1].
This blog post provides insights into the caching, concurrency and stability issues I’ve faced.<p><a href="http://www.gigpeppers.com/post-mortem-of-a-failed-hackernews-launch/" rel="nofollow">http://www.gigpeppers.com/post-mortem-of-a-failed-hackernews...</a>
For <a href="http://pineapple.io" rel="nofollow">http://pineapple.io</a> I had 250 simultaneous users at once, and I believe 16,000 over the course of the day.<p>Server cut through it like butter :) Just lots of caching, optimization, sprites, etc. That traffic isn't even that bad, but I was happy my rails code performed nicely.
Tip: if you have an image-heavy blog, don't host the images somewhere that charges extra for exceeding a network traffic limit. Getting an overage charge email was how I discovered that my fractal article full of pictures was on HN.<p>As an aside, I found that being on Reddit can give much, much more traffic than HN.
2.5 GB virtual server? You don't need that at all. I use shared hosting for my blog, and yet I survived several hours as #1 on the HN front page. The trick? Static HTML pages (made with a homemade PHP blog system, but I could just as easily have used one of the many static site generators).
You can just use free services to host your wordpress blog without any trouble. Set it up on AppFog or OpenShift, use cloudflare too, and use a cache plugin if needed. I don't think any HN-effect could take that down.
I am preparing a new blog, that I do have the intention to have it featured on HN sometimes.<p>For now what I will do is use a very lightweight Wordpress theme, and cloudflare.<p>Is that enough?