How to prepare your site for Digg Effect (Diggstruction)
When a site was dugg to the front page of Digg, the amount of requests to the server will usually take down small sites running on relatively low end hardwares (small RAM, slow CPU, HDD). To prevent this from happening to your site (specifically, WP blogs), there are things you can do to maximize what low end hardwares can manage, and therefore prevent the Digg Effect.
From last experiment, I am very aware this $69/mo (now $99/mo) 1&1 Dedicated Root Server with 2.0Ghz Celeron, 512MB RAM and 40GB HDD cannot take on Digg Effect without doing some tweaking. Here are the measures I’ve gathered:
1) Cache it: WP-Cache 2.0
A very-easy-to-install-and-use plugin. By creating cached pages, it reduce the php code parsed by the web server, and also eliminate the query to mysql database. Both speeds up the page load dramatically.
You can test to see the difference by doing very simple test, this is what I get:
Without cache:
time wget http://blog.tarotoast.com/
>> 0.005u 0.007s 0:01.36 0.0% 0+0k 0+0io 0pf+0w
With cache:
time wget http://blog.tarotoast.com/
>> 0.003u 0.012s 0:00.02 50.0% 0+0k 0+0io 0pf+0w
I don’t really know what all numbers mean, but I know the time for the request is reduce from 1.36 second to .02 second. Keep in mind, however, counter plugins (like Counterize) will not count requests for cached pages (so you don’t feel as good).
2) Apache 2: MPM Worker
Taken directly from Apache’s website:
This Multi-Processing Module (MPM) implements a hybrid multi-process multi-threaded server. By using threads to serve requests, it is able to serve a large number of requests with less system resources than a process-based server. Yet it retains much of the stability of a process-based server by keeping multiple processes available, each with many threads.
In order to use the php module, you need to compile it with thread safety.
3) Stress Test with ab
ab stands for Apache Benchmarking
ab -n 100 -c 100 -d http://URL
This will give you an idea how your webserver can handle traffic.
*Warning: set the number small and increase it slowly.
4) Additional Tweakings
- Configuring Apache for Maximum Performance: easy to read article giving a lot of tips in configuring your apache server.
- eAccelerator: cache php pages at compiled level, which means your php codes will stil be executed. Much faster than no cache at all.
56 Comments + Add Comment
Got anything to say? Go ahead and leave a comment!
Categories
- Bioinformatics (1)
- 當我們同宅一起 (12)
- Family (16)
- Footprints + Diary (150)
- 2005 Summer Road Trip (9)
- 2005 X'Mas Seattle (8)
- 2006 Summer (14)
- 2006 Winter Caribbean (1)
- College (Mesa) (2)
- College (UCSD) (23)
- High School (US) (2)
- Recreation (8)
- Fun+Humor (32)
- Interests (10)
- IT (98)
- recipe (1)
- Reflection (37)
- Server Diary (37)
- ffmud.net (1)
- lmj.tw (3)
- slicehost (1)
- tarotoast.com (11)
- twfamily.org (2)
- tworz.org (1)
- software (1)

Posted under:
[...] How to prepare your site for Digg effect [...]
I use WP-Supercache, this works really good and gives maximum caching through gzip browser compression. Try it!
[...] How to prepare your site for Digg effect [...]
Thanks for sharing! I dont digg, cause my blog is german, but the caching plugin gives much more speed, every WP-blog should use it, to not waste cpu power.