Mad, mad propz to DownTownHost
by Sapphire (December 11, 2007)
One of my sites - the same one that experienced a Digg-like effect - crashed (or helped to crash) the DownTownHost shared server it’s on yesterday. There was no traffic spike, so I can’t figure out what caused the problem. The host reported that it was just too many MySql queries happening at the same time.
I had WP-SuperCache running - in lockdown mode, even - so I tried to imagine what could cause this besides an influx of comments. I did have some Italian spam casino site make a lot of hits on a lot of pages yesterday morning, though they only left seventeen comments. I did some research and found the following:
- Paged Comments. When a post has lots of comments, every comment has to be queried from the database every time the page is loaded, regardless of whether the visitor comments. Breaking the comments down into several pages not only reduces this load, I think it’s nicer for the visitor.
- I followed Lorelle’s instructions on replacing some php calls in my theme with straight HTML. I think this actually makes a big difference on load time, too.
- I followed Lorelle’s instructions on removing even deactivated plugins, too. Which is something I usually do, I’m just mentioning it here because I know it’s important.
- I replaced Gravatar (which queries Gravatar for people’s images) with Dan’s Avatar Thingy, which does not. Only registered users of your site can upload an avatar, but that’s fine for my purposes. Dan’s script is much smaller, which I hope means it will save on page load times. Which has nothing to do with excess MySql queries, but it’s still good.
- And I - belatedly - realized that hosting photos on your own server is no longer the best option, because Flickr has proven very reliable (compared to free services a few years ago), so why not let them host it for you?
Now we get to the mad propz. Not only did DownTownHost once again contact me rather than suspend my site, they offered suggestions. Upon hearing I had WP-SuperCache running, they found PostQueryAccelerator and suggested I try that, and they would handle the server config changes to make it work. Everything worked fine this morning.
The strange thing is, though, on PQA’s page, you’ll note at the bottom it says the plugin won’t be needed once WordPress 2.1 comes out. For the same reason MaxBlogPress’s PingOptimizer was supposed to become less helpful once Wordpres 2.1 came out: because 2.1 was supposed to fix the way WordPress (mis)handled future posts. But as soon as we got PQA running, I saw improvement in the speed of pageloads (and confirmed this at WebOptimization), just as I saw an improvement in feed handling with PingOptimizer. And as I said in my post about PingOptimizer, no one seems able to confirm that 2.1 actually did fix the problem. So, uh, whatever.


August 14th, 2008 at 7:30 am
[...] to straight HTML (how often do you create new categories, after all?) and follow the other tips in this post, and you’ll more than offset the gain of a couple of php calls. Your Ad [...]
February 21st, 2009 at 1:39 pm
[...] Use caching software, reduce php calls - anything you can do to minimize how much your site uses in server resources. I left this one for last not because it’s the least important, but because it’s been covered a million times in other “How to prepare to get Dugg” articles. [...]