Well, it’s no secret to anyone reading my blog that we’ve been experimenting with building dig-proof sites. Today, those experiments took a huge leap forward. It’s probably also no secret that I’m a bit of an Apache fanboy – I’ve been using it for well over a decade now, and I’m a little reluctant to let go of it.
However, Apache has to take a back seat for some of our sites now (at the time of writing, Hungry Hacker is the only one) as we’re giving nginx a test drive. The preliminary results are stunning – absolutely stunning.
At first I wasn’t convinced, because on my little home test server (a celeron with measly amounts of RAM) it appeared like both Apache (event MPM, tons of modules removed, all kinds of speed hacks) and nginx (out of the box from ports) both appeared to run out of steam around the same time.
A short time later I realized that while the benchmarks on both machines appeared to choke up around the same place, the box was a whole lot more responsive with nginx under siege. While Apache was able to keep up with nginx (something to the tune of 2-4% behind it), the shell on the machine was pretty unstable during it.
So I decided to give it a shot on a live server, with a live site (hungry hacker), considering there’s very little involved in building nginx at all. With a bit of config-fudging, I managed to build a reverse proxy out of nginx for dynamic pages, with super-cached pages being served directly via nginx. The results are like night and day (it should be stressed these are non-keepalive requests):
Apache: 684.73 [#/sec] (mean)
nginx+Apache: 10027.18 [#/sec] (mean)
Without gzip enabled (I’m working on some nginx-config-fu to selectively serve pre-compressed super-cache files to browsers that’ll accept it, so far without much success), the ~10,027 requests/second resulted an almost-saturated gig-e port.
If we can pre-cache the text-based data (average savings of ~65% or so on Hungry Hacker), I’m pretty optimistic we can host absolutely surge-proof WordPress sites.
Akismet’s still proving itself useful, blocking a ton of shit like lipofuze reviews and other diet pill crap along with the usual suspects of “I really enjoyed your blog! I will check back often” on what’s usually the most boring page on the site. The real irony was that a good proportion of the spam is aimed at Strykar’s article on screwing over spammers!