How to survive a tweet from Stephen Fry (and why Heroku rocks)
Shortly after relaunching Hackerbuddy last week, I was lucky enough for word to spread - being voted up on Hacker News and Reddit, as well as shared on Twitter quite a bit. Yesterday morning, the world famous actor, tech-lover and national treasure Stephen Fry tweeted about the site (thanks Stephen!).
His tweet (and the retweets from some of his 3.4 million followers) led to a huge increase in traffic, with a ton of requests coming in at once.
There were two things I had in place that helped enormously to survive the rush in traffic. Firstly, I'm using Chartbeat - a real-time analytics dashboard which also allows you to set up alerts. If traffic spikes, you can have Chartbeat send an alert straight to your phone, or email you. If you're off somewhere else, and something happens that causes a huge spike in traffic, Chartbeat lets you respond immediately. I really can't recommend it enough, and it's priced at something like $5/month, which is amazing value. There's also a free trial so you can check it out, with more details here: http://chartbeat.com/tour/.
The second thing that helped save the day was the fact that the site is hosted on Heroku. Heroku has been fantastic ever since I switched to it - scaling up how many dynos (which handle how many HTTP requests you can accept) to how many workers (which manage writes to the database) was as simple as running the command "heroku scale web=10 worker=6" and, just like that, the site was able to handle the traffic. When it dies down, you can just run heroku scale to scale it back down, and if you're not on the Cedar stack, you can also just use the web interface at Heroku.com.
I know for a fact that my old hosting wouldn't have been able to cope with the traffic - it would frequently suffer whenever there was an unexpected spike, but Heroku didn't even flinch.
tl;dr - Chartbeat lets you know when traffic spikes. Heroku helps you deal with it.