Live data from Hacker News

Ask HN: How would you handle a large traffic spike (eg. being frontpage on HN)?

news.ycombinator.com

31–32 of 32 posts

Re: Ask HN: How would you handle a large traffic spike (eg. being frontpage on HN)?

#31
To prepare:

1. Load test and fix what breaks. In the fastest and least-sophisticated way, this is just taking typical requests and throwing increasing numbers of them at your server until it breaks (or if you're testing in production, until user experience begins to deteriorate). This is the most accurate way to identify performance bottlenecks and also gives a rough estimation of your total capacity. If you do nothing else, do this.

2. Make sure your failure state isn't disastrous (for example, if our servers go down, you're still presented with a somewhat-functional webapp, not a 503 error page).

3. Make sure you are able to (and know how to) identify when systems are failing due to traffic and quickly add capacity to any component of your system. Ideally you have SMS/email alerts for this (they're really easy to set up in AWS, for instance).

"Hugs of death" (at least at the HN or even large subreddit scale) are not usually caused by lack of raw computing power, they're usually caused by architectural/algorithmic flaws exposed by unusual request volume. Send that traffic yourself ahead of time, and then fix those.

This is essentially how sites and services for large hardware launches are scaled (such as console launches), just with more sophisticated methods. I took this approach with Guilded (http://www.guilded.gg) and the hug from hitting #2 on a million-person subreddit only reached about 15% of capacity.

Re: Ask HN: How would you handle a large traffic spike (eg. being frontpage on HN)?

#32
post #20

My company did some email marketing that would spike traffic to 50,000 visitors in 30-60 mins and Wordpress MySQL would go nuts. Who knows how many horrible plugins marketing had in there but first go to for me was varnish, then cloud flare then final awesome fix was swapping everything to static HTML that we crawled every night ourselves from our own htaccess blocked Wordpress. Only thing that had to be dynamic /do…

>Who knows how many horrible plugins marketing had in there Why aren't you proactively working with "marketing" to figure out why they installed the plugin and helping them reach their goal in another way?

I've seen many marketing departments go around IT because they perceived it as too rigid, slow and inflexible.
Post reply on HN