Posted By: cody
Last Updated: Saturday September 27, 2008
What do all of these websites have in common? They bring ungodly amounts of traffic to the (un)lucky patron who reaches the frontpage - so much that it brings a good portion of hosts to their knee’s for the sudden surge in traffic. Namely shared hosting providers are affected the most by this since their are numerous websites on the same server - meaning that there is *typically* less room for excessive resource usage.
Well, about a week ago one of our customers got on the frontpage of Digg, Reddit, and had a huge amount of popularity on other social networks such as Mixx and Stumbleupon (granted this isn’t the first time one of our customers has been “Dugg” - it was the first time we’ve seen such a large influx of traffic in such a short period of time). After seeing Apache get a little moody in the evening we took a peak to see why.. after a little bit of detective work we saw a huge amount of referrers from Digg, Reddit and crew.
After watching the server for a good 10-20~ minutes during the surge of traffic we were pleasantly greated with a < 1.00 load average through the whole debacle - the WordPress blog that was serving the content didn’t even hiccup (so for those of you who say 25 simeltaneous MySQL connections isn’t sufficient, well neener).
Even though in this instance no action was needed on anyones part - everything was being served properly, no slow downs, the server just burped and continues on spitting out webpages, we did prepare a simple static cache of the page that was receiving the most amount of traffic just in case the clients website was causing a issue / slowing down - it was a simple “.htaccess” rule that would see if the referrering URL was the Digg URL - if so it would just point to a static HTML file instead of making PHP/MySQL serve up the page over and over. Though we didn’t need to use it - it prompted me to post this blog post with some tips if you’re receiving a high amount of traffic on ANY shared provider .. there is a chance that you’ll use a sufficient amount of resources and be suspended for affecting other customers experience (better play it safe eh?).
This was just touching the surface of simple ways to “cache” your website - look for a post in the near future explaining these methods further and some other ways to optimize your website.
Just for kicks here’s the bandwidth graph’s of when the clients side got bombarded from the numerous sites.. needless to say it kind of “stuck out” a bit more than normal ;).