Fighting The WordPress Dragons
What follows is a quick tale into the technical details of WordPress that I’d rather not think about, but was forced to…
Over on PCMech, I have been having a cyclical and perplexing issue with server load. The end result was that PCMech disappeared from the Internet for a few minutes at a time, several times per day.
Extremely frustrating to say the least. Especially when you pay your web host about $700 per month to keep these sites online.
A few weeks ago, I started host shopping. I am with Pair Networks now, but I started talking with the guys at Rackspace. Both great companies. Rackspace is certainly more proficient with their marketing, but they also back it up. I’m not even a customer and I can tell that their “fanatical support” is indeed what it says. That said, Pair is no slouch either. Pair is always spot on with their email replies and they get the job done.
At the end of the day, I’ve got a business to run, however. As good as Pair is, if they can’t get it done for me, I switch. The prospect of moving all of my sites to Rackspace wasn’t exactly one I wanted to confront. At the last minute, fortunately Pair came through for me and offered to throw a lot more hardware in my direction. Essentially, it was an offer I couldn’t refuse.
As I had left it, WordPress was still proving to be a beast, but we threw so much hardware at it that it was acceptable. Still, PCMech was slower than other sites.
Fast forward to this morning. PCMech is gone. Buh bye. WordPress is delivering nothing but blank pages.
When I check out the cache, it looks like the problems started shortly after 4AM.
I was clueless. And, again, my host was pissing me off. I pay these guys so much money, and essentially I was getting fast responses and some hints about the problem, but no solutions. They told me, essentially, that they weren’t that familiar with WordPress. This was surprising considering WordPress is pretty much the most common blog platform on the net.
After wasting several hours on it, all while PCMech was offline, I was beginning to feel pretty damn helpless. I started thinking about my personal network of contacts.
Mark Jaquith came to mind. He seemed ideal. He lives local to me, we know each other, and he also happens to be one of the lead developers for WordPress. So, I decide to invade his space, look him up on Skype and I interrupt his day.
In short, Mark saved my ass. He’s a good guy to know.
Come to find out, there are two problems at play here…
WordPress Options Table
The WordPress database has a wp_options table. By design, the WordPress code queries pretty much every row from this table on each page view (specifically, the ones marked “autoload”).
Well, my options table had over 600 entries and was over 23MB in size!
Mark cleared out some bogus entries, shaving the table down considerably. I went in afterward and removed a bunch of crap from old plug-ins.
Seriously, plug-ins add a bunch of CRAP to your options table. When you deactivate the plug-in, that crap remains in there and is queried out of the database each page view. It is excess baggage. I had to go in and remove entries by hand.
This alone brought PCMech back from the dead. The consistent queries which were returning a result set of over 20+ MB was just killing the server, eating up all the memory, and causing Apache to restart cyclically.
Apache Process Size
This issue remains unsolved as of now, but I’m working on it.
Each Apache process is using up about 50MB of memory. That is insanely high. WordPress itself, we have ascertained, is only using around 5.5 MB. I’m not loading excessive images from the server, and all videos are hosted offsite.
Still to look into is whether we’ve enabled a bunch of Apache modules that are being called up that I’m not even using. I’m also going to look through the code and see about thinning down the number of images.
Every image and every video (essentially, every single file) has to be served by Apache. Lesser is better.
WordPress Is a Beast
WordPress is very query-intensive and uses a lot of memory, especially when you have it loaded up with plug-ins. Of course, I am also using vBulletin on this server, and it uses a lot of database queries, too.
When you start subjecting it to high traffic, it can really take your server to its knees. Some other things I have done include:
- Getting rid of all unessential plug-ins.
- Installing an opcode cache (like APC or Eaccelerator)
- Installing WP Super Cache.
- Host databases on a separate server. This is the reason I actually have TWO servers with Pair Networks.
I’m going to continue to watch the server and watch that uptime.
I guess this is the kind of stuff you deal with as part of being a pro blogger.
Oh, and thanks again to Mark. You da man!

Like what you read?
If so, please join over 12,000 people who receive exclusive online business and blogging tips, and get a FREE COPY of my eBook, Six Figure Blogger Blueprint (PDF and MP3)! Just enter your name and email below:
-
http://website-in-a-weekend.net/ Dave Doolin
-
http://erica.biz ericabiz
-
http:www.carolynbahm.com cbahm
-
Richard60
-
http://thatcomputerguy.net.au/ Dan Rippon
-
http://website-in-a-weekend.net/ Dave Doolin
-
http://zemalf.com/ Antti Kokkonen – Zemalf.com
-
http://mailamovie.info/ Steve
-
http://www.johnpaulaguiar.com John Paul
-
http://www.blogmarketingexperts.com/ Bruce Inouye
-
Alberto
-
http://davidrisley.com David Risley
-
http://davidrisley.com David Risley
-
http://davidrisley.com David Risley
-
http://www.musee.com/ storesonline
-
http://money.cnn.com/magazines/business2/b2fastestgrowing/2007/snapshots/2.html imegent78
-
http://drivingspirit.com/ Chris @ Driving Spirit
-
joebwharton
-
http://www.sixprizes.com/ Adam
-
http://www.nextlevelblogger.com/about Christian
-
http://www.iphone3gclone.com iphone clone
-
http://www.iphone3gclone.com iphone clone
-
http://twitter.com/WordpressWB Mitz WordpressWB
-
http://davidrisley.com David Risley
Hey, I'm David. Dont' know where to start? No worries. Let me help you get started.
The Six Figure Blogger Blueprint - PDF Edition... to discover the exact blueprint to generating six figures from your blog.


