I am completely amazed by the amount of traffic and emails I have received after launching digpicz.com.

Digpicz received an incredible amount of 100'000 visitors during the first 20 hours! I launched it at 3am (my local time) and it got submitted to digg.com by Ilker Yoldas from TheThinkingBlog soon after, and it made to the front page of Digg two hours later.

According to statcounter.com by midnight it had been visited by 100'727 unique visitors. During two days it has been online (September 2 and September 3) 130'848 uniques have made 265'836 page requests.

Since I was running it on a shared hosting server ($9.95/monthly at Dreamhost), I had foreseen that there might be problems with dynamically generating page on each request (for example, taking data from the database and creating HTML output using PHP or Perl) and all the pages on the website were simple pre-generated HTML documents. Once a new picture was added only the index.html (default page) was regenerated.

I use Wordpress blog platform for this blog and it is not really designed with handling slashdot like effects (digg effect, for example) in mind. If no optimizations are done, traffic spike usually just bring the server to down to hell. With all the plugins I use on this blog, Wordpress makes like 40 SQL queries for each served page and then runs the whole content through filters and hooks and whatnot.

I did not expect the site to get Dugg that soon and had not made any optimizations to the blog.

The post made it to Digg's front page in 7 hours and the traffic brought the whole shared hosting server to knees. The blog stopped responding and I had to do something because I was losing many, many potential new readers and subscribers.

I tried installing Wp-Cache 2 plugin on my local development server with an idea to upload it via FTP to shared hosting but the plugin didn't want to work. I have no idea why and I didn't have time to debug the problem. I had to find another solution.

I had set up my blog to use permalink link structure and I remembered that the mod_rewrite directives (ps. here is an excellent mod_rewrite cheat sheet) in .htaccess file, which sets up the link structure, avoided rewriting links if an existing file or directory was requested.

There two lines in the .htaccess generated by Wordpress saved my blog:

The story Digg linked to was /blog/designing-digg-picture-website/. I quickly created this directory on the server. Now the second RewriteCond rule started working and I instantly noticed the load dropping from 350 to a very low value. Then I created a stripped version of original article and placed it as an index.html file in the newly created directory. The stripped version looked like this. That's it, the load had dropped, the pages were being served, I was happy and readers were happy as well. :)

According to Statcounter my blog received 36'389 unique visitors during these two days:

And the feed subscriber count (at FeedBurner) increased from 104 to 311 (During September 2):

I can't wait to see how many blog subscribers I will have once the data for Tuesday is updated! :)

I can tell you a little secret now. You know popurls.com, right? If you don't, then it's a website which aggregates all the best buzz around the net from sources like digg, reddit, del.icio.us, newsvine and many others.

I bought a nicely named domain last week and I am working on a picture aggregation website which finds all the latest posts on all the social websites and displays them on a single page. :)

Expect this website to be out by the end of the week, presumably Sunday. I will probably write a two-part article on how this baby was created, how much time it took me and I will release the full source code as usual.

Awesome, that pic aggregator idea is brilliant Digpicz is fantastic. By the way, I submitted Digpicz to StumbleUpon and send the link to a bunch of friends who also voted it up - hope that helped with traffic too!

Interesting work on the optimization. Let us know if you invest any more time into optimizing Wordpress for traffic. WP-Cache is a start but even with that enabled I don't think any shared account could survive 100,000 hits.