Current

Saturday, April 26, 2008

Cacheing In

Posted by Devil's Kitchen at 4/26/2008 09:46:00 pm

Your humble Devil has been slightly concerned by the fact that his once reliable server has been falling over quite a lot recently. Indeed, the other night, it fell over three times in the space of half an hour—apparently because Timmy had been linked to by Instapundit.

This just shouldn't happen: the server is quite fast, has unlimited bandwidth and is nowhere near capacity storage-wise. Why should it keep falling down?

And then, via Daring Fireball, I found this Coding Horror article—Behold WordPress, Destroyer of CPUs.
I've been thoroughly impressed with the community around WordPress, and the software itself is remarkably polished. That's not to say that I haven't run into a few egregious bugs in the 2.5 release, but on the whole, the experience has been good bordering on pleasant.

Or at least it was, until I noticed how much CPU time the PHP FastCGI process was using for modest little old blog.stackoverflow.com.


For context, this is running on a Windows Web Server 2008 virtual machine with a single core of a 2.13 GHz Xeon 3210 entirely dedicated to it.

This is an incredibly scary result; blog.stackoverflow.com is getting, at best, a moderate trickle of incoming traffic. It's barely linked anywhere! With that kind of CPU load level, this site would fall over instantaneously if it got remotely popular, or God forbid, anywhere near the front page of a social bookmarking website.

For a bare-bones blog which is doing approximately nothing, this is a completely unacceptable result. It's appalling.

And now that I think about it, my server only really started crashing regularly when I started to install WordPress blogs on it (for a variety of other reasons, mainly to do with design, I wouldn't touch WP with a bargepole if I had the option).

And, thinking about it further, the server has been crashing proportionately more, the more WP blogs I have installed. And now, I'm pretty sure that I know why.

There is a solution, which I have just implemented on Timmy's blog and I shall try to roll out to the others when I have time.
As evidence of what a systemic problem this is, there's an entire cottage industry built around shoehorning better caching behavior into WordPress. Take your pick: WP-Cache, WP-Super-Cache, or Bad Behavior.

It is WP Super-Cache that I have installed, and I shall be monitoring how it goes. The results should be good, as Jeff illustrates.
Does it work? Does it ever. Here's what CPU usage looks like with basic WP-Cache type functionality enabled:


But this is a little known problem, right? Wrong.
I'm not alone; just do a web search on WordPress CPU usage or WordPress Digg Effect and you'll find page after page of horror stories, most (all?) of which are solved by the swift and judicious application of the WP-Cache plugins.

Thanks a fucking bunch, WordPress; are you going to do anything about it?
It's not like this a new issue. Personally, I think it's absolutely irresponsible that WP-Cache like functionality isn't already built into WordPress. I would not even consider deploying WordPress anywhere without it. And yet, according to a recent podcast, Matt Mullenweg dismisses it out of hand and hand-wavingly alludes to vague TechCrunch server reconfigurations.

Well, thanks a fucking bunch, WP team. You cunts.
A default WordPress install will query the database twenty times every time you refresh the page, even if not one single element on that page has changed. Doesn't that strike you as a bad idea? Maybe even, dare I say it, sloppy programming?

Twenty fucking times? That's not sloppy programming: that's nearer to a DoS attack on my bloody server.

And because WP programmers can't be arsed to fix this, all of my customers suffer when the server goes down and I can't actually go anywhere without constantly having to check that my machine hasn't crashed?

You selfish bunch of fucking cunts.
What I just don't understand is why, after all these years, and all these documented problems, WordPress hasn't folded WP-Cache into the core. If you're ever planning to have traffic of any size on a WordPress blog, consider yourselves warned.

I'm warned. And armed. And about to spend a few hours trying to install what should be an unnecessary plugin into my hosted WP blogs.

And, by the way, I'm also really fucking annoyed...

Labels: , , , , , , ,


Posted by Devil's Kitchen at 4/26/2008 09:46:00 pm


4 Blogger Comments:

Blogger Chris said...

Other blogging engines are available...

For example Serendipity (http://s9y.org/) does proper caching built in :)

4/26/2008 11:21:00 pm  
Blogger Roger Thornhill said...

For starters, WP should just put up a big sign suggesting people to consider it.

Sounds like WP have a very bad/broken object model. The oft overlooked maxim in OO "that which has the information does the job" might be worth a visit for them.

Not that I am a purist OO zealot. I am very much an FP fan (Erlang) too.

4/27/2008 09:26:00 am  
Anonymous Pupazz said...

The fact that its running in a Windows-based virtual server probably doesn't help. Windows IIS doesn't support PHP naturally, and has to be given the ability via extensions.

I personally use WP with a MySQL database running on the same box - Windows Server 2003 - and my server box is only something that I threw together from spare parts - and I have never noticed anything like this taking place. I'd suggest that its less of a WP problem and more of a server config issue.

4/27/2008 12:01:00 pm  
Anonymous Anonymous said...

Let's cut them some slack. I'm guessing that the WP people wanted to make the install relatively easy for a variety of situations and couldn't assume persistence.

If you're running a heavy site then RTFM and prepare to get your hands dirty.

4/28/2008 04:47:00 pm  

Post a Comment

Links to this post:

Create a Link

<< Home

Testimonials

  • "The best British political/libertarian blog on the web. Consistently excellent but not for the squeamish."—Christopher Snowdon
  • "[He] runs the infamous and fantastically sweary Devil’s Kitchen blog, and because he’s one of the naughtiest geeks (second only to the incredibly, incredibly naughty Guido Fawkes) he’s right at the top of the evil dork hierarchy."—Charlotte Gore
  • "I met the Devil's Kitchen the other night. What a charming young man he is, and considerably modest too..."—Peter Briffa
  • "The Devil's Kitchen exposes hypocrisy everywhere, no holds barred."—Wrinkled Weasel
  • "People can still be controversial and influential whilst retaining integrity—Devil's Kitchen springs to mind—and attract frequent but intelligent comment."—Steve Shark, at B&D
  • "Sometimes too much, sometimes wrong, sometimes just too much but always worth a read. Not so much a blog as a force of nature."—The Nameless Libertarian
  • "The Devil's Kitchen—a terrifying blog that covers an astonishing range of subjects with an informed passion and a rage against the machine that leaves me in awe..."—Polaris
  • "He rants like no one else in the blogosphere. But it's ranting in an eloquent, if sweary, kind of way. Eton taught him a lot."—Iain Dale
  • "But for all that, he is a brilliant writer—incisive, fisker- extraordinaire and with an over developed sense of humour... And he can back up his sometimes extraordinary views with some good old fashioned intellectual rigour... I'm promoting him on my blogroll to a daily read."—Iain Dale
  • "... an intelligent guy and a brilliant writer..."—A Very British Dude
  • "... the glorious Devil's Kitchen blog—it's not for the squeamish or easily offended..."—Samizdata
  • "... a very, smart article... takes a pretty firm libertarian line on the matter."—Samizdata
  • "By the way, DK seems to be on fucking good form at the moment."—Brian Mickelthwait
  • "Perhaps the best paragraph ever written in the history of human creation. It's our Devil on fine form."—Vindico
  • "Devil's Kitchen is the big name on the free-market libertarian strand of the British blogosphere... Profane rants are the immediate stand-out feature of DK's blog, but the ranting is backed up by some formidable argument on a wide range of issues particularly relating to British and European parliamentary politics, economics, and civil liberties."—Question That
  • "... an excellent, intelligent UK political blog which includes a great deal of swearing."—Dr Aubrey Blumsohn
  • "I like the Devil's Kitchen. I think it's one of the best written and funniest blogs in the business."—Conservative Party Reptile
  • "The. Top. UK. Blogger."—My Vast Right-Wing Conspiracy
  • "For sheer intelligence, erudition and fun, Iain Dale's Diary, Cranmer and Devil's Kitchen are so far ahead of the rest I don't see how they can figure in a top ten. They are the Beatles, Stones and Who of the blog world; the Astair, Bogart and Marlon Brando of the blog world; the Gerswin, Porter and Novello of the blog world; the Dot Cotton, Pat Butcher, Bette Lynch of the blog world..."—Wrinkled Weasel
  • "It's the blogging equivalent of someone eating Ostrich Vindaloo, washed down by ten bottles of Jamaican hot pepper sauce and then proceeding to breathe very close to your face while talking about how lovely our politicians are... But there's much more to his writing than four letter words."—Tom Tyler
  • "God bless the Devil's Kitchen... Colourful as his invective is, I cannot fault his accuracy."—Tom Paine
  • "The Devil's Kitchen is a life-affirming, life-enhancing blog ... This particular post will also lead you to some of the best soldiers in the army of swearbloggers of which he is Field Marshal."—The Last Ditch
  • "... underneath all the ranting and swearing [DK]'s a very intelligent and thoughtful writer whom many people ... take seriously, despite disagreeing with much of what he says."—Not Saussure
  • "... the most foul-mouthed of bloggers, Devils Kitchen, was always likely to provoke (sometimes disgust, but more often admiration)."—The Times Online
  • "The always entertaining Mr Devil's Kitchen..."—The Times's Comment Central
  • "Frankly, this is ranting of the very highest calibre."—The Nameless Libertarian
  • "I don't mean it literally, or even metaphorically. I just find that his atheism aside, I agree with everything the Devil (of Kitchen fame...) says. I particularly enjoy his well crafted and sharp swearing, especially when addressed at self righteous lefties..."—The Tin Drummer
  • "Spot on accurate and delightful in its simplicity, Devil's Kitchen is one of the reasons that we're not ready to write off EUroweenie-land just yet. At least not until we get done evacuating the ones with brains."—Anti-Idiotarian Rottweiler
  • "This hugely entertaining, articulate, witty Scottish commentator is also one of the most foul-mouthed bloggers around. Gird up your loins and have a look. Essential reading."—Doctor Crippen
  • "The Devil's Kitchen is one of the foremost blogs in the UK. The DK is bawdy, foul-mouthed, tasteless, vulgar, offensive and frequently goes beyond all boundaries of taste and decency. So why on earth does Dr Crippen read the DK? Because he reduces me to a state of quivering, helpless laughter."—Doctor Crippen's Grand Rounds
  • "DK is a take-no-prisoners sort of libertarian. His blog is renowned for its propensity for foul-mouthed invective, which can be both amusing and tiresome by turns. Nevertheless, he is usually lucid, often scintillating and sometimes illuminating."—Dr Syn
  • "If you enjoy a superior anti-Left rant, albeit one with a heavy dash of cursing, you could do worse than visit the Devil's Kitchen. The Devil is an astute observer of the evils of NuLabour, that's for sure. I for one stand converted to the Devil and all his works."—Istanbul Tory
  • "... a sick individual."—Peter Briffa
  • "This fellow is sharp as a tack, funny as hell, and—when something pisses him off—meaner than a badger with a case of the bullhead clap."—Green Hell
  • "Foul-mouthed eloquence of the highest standard. In bad taste, offensive, immoderate and slanderous. F***ing brilliant!—Guest, No2ID Forum
  • "a powerfully written right-of-center blog..."—Mangan's Miscellany
  • "I tend to enjoy Devil's Kitchen not only because I disagree with him quite a lot of the time but because I actually have to use my brain to articulate why."—Rhetorically Speaking
  • "This blog is currently slamming. Politics certainly ain't all my own. But style and prose is tight, fierce, provocative. And funny. OK, I am a child—swear words still crack a laugh."—Qwan
  • "hedonistic, abrasive but usually good-natured..."—The G-Gnome
  • "10,000 words per hour blogging output... prolific or obsessive compulsive I have yet to decide..."—Europhobia
  • "a more favoured blog from the sensible Right..."—Great Britain...
  • "Devils Kitchen, a right thinking man indeed..."—EU Serf
  • "an excellent blog..."—Rottweiler Puppy
  • "Anyone can cuss. But to curse in an imaginative fashion takes work."—Liftport Staff Blog
  • "The Devil's Kitchen: really very funny political blog."—Ink & Incapability
  • "I've been laffing fit to burst at the unashamed sweariness of the Devil's Kitchen ~ certainly my favourite place recently."—SoupDragon
  • "You can't beat the writing and general I-may-not-know-about-being-polite-but-I-know-what-I-like attitude."—SoupDragon
  • "Best. Fisking. Ever. I'm still laughing."—LC Wes, Imperial Mohel
  • "Art."—Bob
  • "It made me laugh out loud, and laugh so hard—and I don't even get all the references... I hope his politics don't offend you, but he is very funny."—Furious, WoT Forum
  • "DK himself is unashamedly right-wing, vitriolic and foul mouthed, liberally scattering his posts with four-letter-words... Not to be read if you're easily offended, but highly entertaining and very much tongue in cheek..."—Everything Is Electric
  • "This blog is absolutely wasted here and should be on the front page of one of the broadsheets..."—Commenter at The Kitchen
  • "[This Labour government] is the most mendacious, dishonest, endemically corrupt, power-hungry, incompetent, illiberal fucking shower of shits that has ruled this country..."—DK

Blogroll

Campaign Links

All: Daily Reads (in no particular order)

Politics (in no particular order)

Climate Change (in no particular order)

General & Humour (in no particular order)

Mac,Design Tech & IT (in no particular order)