Search
SEO Logs » social media marketing » Digg vs dnScoop: How I Survived
  • No categories

  • Digg vs dnScoop: How I Survived

    Having had 2 sites (seologs.com and dnscoop.com) go popular on Digg.com, I thought it would be nice to share my experiences in hopes that it may be able to help someone.

    First let me say that this isn’t going to be the usual “How I Survived Digg” article that deals with protecting database driven pages (or even static html pages) from the sudden traffic spike with methods that involve caching (create a static copy of) or routing requests to a mirror of the site that can handle the traffic. I only wish that was all I had to deal with when my sites were dugg.

    Both of my sites featured tools that have to take user input, do some processing, database requests, and calculations on the server, then return a unique result based on the users input. Caching would alleviate the stress on the server, but users would be pretty disappointed when the tool didn’t do what it was supposed to do. So what did I do?

    For my first digg (seologs.com) I didn’t do anything. It took me completely by surprise. The site was hosted on my super cheap shared hosting and pretty much crashed within the first 30 minutes, and it took 10 of my other sites as well as all of the other hundred or so sites that were hosted on the same machine down with it. After about 20 minutes on hold, the site went back up, it as well as the rest of my sites were moved to some crappy auxiliary server that had about 80% up time. I seriously considered moving to a dedicated host, but eventually, traffic died down to a reasonable amount. I can’t begin to explain just how much grief the whole experience caused me, but the next time, I was going to be ready.

    I set up a makeshift script in the head of the sites I was concerned about. This would email me when I had referrers from Digg. I would explain it, but it was pretty much a pain to set up in a way that would only email me once, plus there is a much easier way to get alerted when your site gets Dugg now.

    Being alerted actually made all the difference in the world, because it gave me lots of time to come up with a way to keep my site up, while still allowing people to use the tool.

    This was the bit of code I came up with to put in the header.

    if(!$_POST || $_POST['already']){
    $randomdigg = rand(0,3);
    if($randomdigg != 0){
    exit(”Thanks for visiting, but the site is under a great deal of stress due to being on the front page of Digg. Please try back in a few moments. Thanks!”);
    }
    }

    and This was the bit inside of the <form></form>
    if($_POST){echo '<input type=HIDDEN name="already" value="true">';}

    The tool uses a form with a POST request. So when someone clicks the submit button, the hidden field above is added to the form, so the next time they press submit, the “already” variable is passed to the server. Every time the page loads, the bit of code in the header decides what to do.

    If someone just comes to the page who hasn’t already submitted the form (!$_POST) or if someone has already used the tool once ($_POST['already']), then make them wait in line. The rand function generates a number from 0 to 3, and there is basically a 1 in 4 requests, people will actually get to use the tool, and the rest get my nice “please try back in a moment” message. The “already” variable also makes sure the same person can’t submit more than once in a row.

    So this little script actually kept the rest of the site up and going, while still allowing people to use the tool. The site was on the same shared host as the first one, but the little script made this digg experience really positive one.

    If you enjoyed this post, make sure you subscribe to my RSS feed!


    Leave a Comment