If your website is slow then people will either get annoyed with it or simply not visit it. Bottom line – you can lose money.
I met Donncha in real life for the first time a few months ago and one of the things that I was anxious to talk to him about was WordPress’ speed or lack thereof, as both my own sites and those of clients etc., seemed to suffer from performance issues.
This site has been known to do over 100 gigabytes of transfer in a month, so performance can become an important factor.
Donncha, who works for WordPress fulltime, was adamant that WP itself was not to blame. As I had previously suspected the culprits were badly written plugins.
Unfortunately this is one of the downsides to PHP.
It’s simply TOO easy to write bad PHP code. If even I can release a modified plugin (and I cannot program to save my life) then you know what I mean!
Evaluating Performance
Prior to the reinstall on this site the number of SQL queries per page was outrageous, with some pages requiring well in excess of 100 SQL queries to render!
If you look in the page footer now you can see that it’s been cut back significantly.
Server Side Options
On the server-side I’m using MySQL 4 – simply because it ships with Ubuntu. The Ubuntu config includes some caching already, but the max clients setting had to be increased significantly, as the server would become either slow or simply unresponsive at least once every 24 hours. The fix for that was simply to “borrow” a config from a much busier server 🙂
On a sidenote. If your site is really important to you and is a major source of revenue, be that direct (sales / affiliate sales / advertising revenue) or indirect (such as business referrals worth thousands of Euro) then going dedicated or at least semi-dedicated is the only sane option. You simply cannot run an important site in a shared environment.
Apache could be optimised further by simply removing unwanted / unneeded modules OR, as some people have suggested, by replacing it completely with a lighter HTTPD.
Php could be sped up using a caching mechanism. As none of the open source PHP caching solutions seem to be available as Debian / Ubuntu packages I have decided not to try this method as yet, however, if anyone has done so I’d love to hear about your experiences.
Instead of upgrading the backend, and leaving loads of old files lying around the place, a clean slate definitely helps.
Now, in my case, getting a “clean slate” was not intentional, however it has paid dividends.
If you cannot think of a valid reason to use a plugin, then you can probably do without it. There is no reason to have more than a couple of plugins enabled. If you need tons of plugins then you probably should consider using something else or maybe writing your own software…
One of the plugins I find particularly useful is Brian’s latest comments, however the “stock” version is rather heavy, as it generates SQL queries on each and every page load. Donncha “WordPress” O Caoimh rewrote it so that it’s a hell of a lot saner.
(thanks!)
Another plugin that was worth enabling is Wp-Cache. The latest version includes some improvements supplied by Mr O’Caoimh 🙂
What both of these plugins do is create static files on the physical disk instead of relying on MySQL to do all the work. (This is one of the reasons why some sites such as search.ie or blog.blacknight.ie use the Perl scripts that they do!)
I’m not sure what else I can do at this point to speed things up, as I’ve effectively taken the number of SQL queries per page from an alltime high of about 110 to about 30 (or less)
If anyone has any other suggestions I’d love to give them a go







Leave a Reply