I've been wondering about WordPress plugin overhead for some time. How does one keep track of how much processor time and overhead any given plugin requires?
We run fairly streamlined WordPress installs at Foliovision with about 30 active plugins per site. A lot of them are one-trick ponies developed in-house so we know the code isn't creating a huge load.
But anyone who has been working on Macintosh computers from the old days (System 7, 8 & 9) knows very well that every extensions (and some people were running 50 of them) slows down your compuer and increases the chances of a system conflict. There were whole expensive utilities devoted to keeping extensions and control panels under control. Any one else remember long hours spent with Conflict Catcher?
Here's what WPdesigner.com has to say on his own plugin issues:
With the WP Download Monitor plugin, the front page of my blog had to operate with 136 queries on every page load. After uninstalling that plugin, the front page needed only 10 queries to work. 136 versus 10 and all I have to do is give up tracking the downloads, hmmm.. oh what, oh what should I do? I deactivated / uninstalled it, of course.
So some plugins are clearly worse than others. I hope I didn't publish that post recommending Lucia's LinkyLove for DoFollow. In the comments to the post above David Airey notes.
I found the real culprit - the LinkLove plugin for DoFollow comments.
By de-activating it I’ve dropped the queries from 117 to 24 on my blog post with 46 comments.
Lucia's LinkyLove plays complicated games rewarding commenters for more comments with better links. A pox on this sort of brownie point system. I will get DoFollow turned on and will rely on Akismet and common sense to keep the spammers off. Everybody else is welcome to followed links.
Ironically enough David's post recommending Lucia's LinkyLove still stands and is ranked high - that is not taking very good care of one's visitors. Perhaps he just forgot. Even more ironically, Lucia publishes another plugin to track CPU greedy plugins. I don't recommend this plugin, as it is ugly and is less useful than adding a simple PHP tag to your footer to track both database queries and CPU time.
<!--<?php echo $wpdb->num_queries; ?> <?php _e('queries'); ?>. <?php timer_stop(1); ?> <?php _e('seconds'); ?>.-->
At this point you can load any page on your weblog and check the number of database queries and the CPU time just by viewing source. If you are really on a roll, you can remove the html comment markup from around the PHP tag and you will be able to see the load times and database queries without checking source. So will your visitors, but for a half an hour of quick testing it really doesn't matter.
Here's the PHP code alone:
<?php echo $wpdb->num_queries; ?> <?php _e('queries'); ?>. <?php timer_stop(1); ?> <?php _e('seconds'); ?>.
So with 30 WordPress plugins running, what's the damage on Foliovision.com and client sites?
On Foliovision.com, 37 queries. 0.465 seconds for the home page and 30 queries. 0.506 seconds for a single post. The client sites are mostly in the same thirtyish queries neighbourhood. Clearly in there are a couple of plugins which are borderline greedy. I'll have Peter do some tests on Monday. For comparision, with over 41 plugins, Saman's install requires over 1.6 seconds to generate a page.
Generally I am happy about this result. It means the base FolioPress suite is quite efficient. Efficiency in coding is very important to me. Alas, the big three in OS have quite forgotten about efficiency: MS Windows, Apple OS X and KDE are all horribly inefficient: I have to run a quad processor to get decent performance out of Apple. Absurd. But malicious inefficiency in coding is a subject for another post.
How important is it to avoid greedy WordPress plugins? If you get little or no traffic or you are on a dedicated server, it's probably not all that important. But if you are on shared hosting (broken link - http://www.ngtech.gr/blog/en/programming/php/turbo-charging-wordpress-or-how-i-made-my-wordpress-blog-1000-faster-2006-10-21.html) and you ever get Dugg, Slashdotted or listed at Yahoo, watch out. Your hosting may be disabled for a week due to the one or two errant plugins.
Alec has been helping businesses succeed online since 2000. Alec is an SEM expert with a background in advertising, as a former Head of Television for Grey Moscow and Senior Television Producer for Bates, Saatchi and Saatchi Russia.