Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I detect and survive being "Slashdotted"?

What's a good way to survive abnormally high traffic spikes?

My thought is that at some trigger, my website should temporarily switch into a "low bandwidth" mode: switch to basic HTML pages, minimal graphics, disable widgets that might put unnecessary load on the database, and so-on.

My thoughts are:

  • Monitor CPU usage
  • Monitor bandwidth
  • Monitor requests / minute

I am familiar with options like caching, switching to static content or a content delivery network, and so on as a means to survive, so perhaps the question should focus more on how one detects when the website is about to become overloaded. (Although answers on other survival methods are of course still more than welcome.) Lets say that the website is running Apache on Linux and PHP. This is probably the most common configuration and should allow the maximum number of people to gain assistance from the answers. Lets also assume that expensive options like buying another server and load balancing are unavailable - for most of us at least, a mention on Slashdot is going to be a once-in-a-lifetime occurrence, and not something we can spend money preparing for.

like image 799
MrZebra Avatar asked Oct 20 '08 12:10

MrZebra


1 Answers

  1. install munin to monitor load/memory consumption etc and notify on overloads.
  2. install monit to restart apache2 if it crashes
  3. install nginx as apache2 frontend, it will massively decrease memory requirements under heavy load
like image 121
yanchenko Avatar answered Sep 20 '22 17:09

yanchenko