

Ask HN: how do you prepare for a traffic spike (i.e. from HN)? - wallawe

You see this all the time. Blogs or websites go down when they reach the main page of Hacker News.<p>My question is, what do you do to prepare if you are expecting such traffic hikes? I use hostgator for example and have never had massive amounts of traffic to any of my sites as of yet, but wonder how it would hold up under intense loads that HN or reddit might bring.
======
factorialboy
I was on the front page last week. Needless to say my self hosted Wordpress
crashed (Nginx, PHP, Wordpress, MySQL).

Here's what I did: [http://www.srirangan.net/2012-10-leaving-php-mysql-
wordpress...](http://www.srirangan.net/2012-10-leaving-php-mysql-wordpress-
behind)

------
staunch
This is almost purely a matter of what software you're running. Just about any
server can handle HN traffic if it's serving static content using a event-
based server like nginx.

Oh the other end, if you have a dynamic web site that's doing heavy DB queries
on every request, even a relatively small rate of requests can bring you down.

A basic scaling strategy is pretty straight forward. 1) Any content that can
be static should be, and most content can be static. For example you can make
Wordpress serve posts as static files using plugins. 2) Any dynamic content
should rely heavily on caching (DB queries in memcached and HTML content in
Varnish, for example).

~~~
wallawe
Thanks staunch, good info. Where I can read/learn more about these strategies?
It's not something I have delved into in any manner and would like to learn at
least a little more about some of these methods.

~~~
staunch
I'd recommend just using the Google. Search for
"(Rails|PHP|Wordpress|MySQL|HTTP|Varnish) caching". Lots of great tutorials
and articles come up.

------
robbiea
wpengine.com It's a lifesaver for me.

~~~
e1ven
I'm curious what this gives you that wordpress.com doesn't?

