How To Increase Your WordPress Site Performance (Without Losing Functionality) by 10 TimesBy Angsuman Chakraborty, Gaea News Network
Sunday, December 31, 2006
WordPress bloggers often engorge themselves with tons of plugins which are freely available (free wordpress plugins we provide). However quality is not assured with most of the free plugins out there in the wild and often they end up significantly slowing the site. How can you assure optimum performance without sacrificing functionality?
Note: We do extensive QA and performance testing of our WordPress plugins before we release them. We can assure you of their quality and performance.
You must consider using a caching plugin to optimize your site for performance. Caching can drastically improve your site performance by storing your generated pages and serving them instead of creating them on the fly which involves lots of PHP processing and more significantly MYSQL database access. Both of them affect your scalability which is addressed by a caching plugin.
wp-cache 2 Plugin
I recommend wp-cache 2 at this time. You will however need to deactivate compression on the Miscellaneous options screen and ensure “that gzip encoding is turned off on the PHP level”.
I recommend it over external caching engines like eAccelerator because it is senstive to changes in WordPress content and will automatically refresh the cache. However it has a downside. On highly commented sites the effects of caching is negated because of frequent cache refreshes. This can be addressed by this tip:
How to improve performance of highly commented WordPress blogs
Personally I have seen that it works fine even with gzip encoding at php level. But I have a better solution as described below in compression.
WordPress Object Caching
WordPress introduced file based caching of php objects in 2.x versions. It caches recurrently used php objects thereby reducing MySQL calls and improving performance.
It is currently disabled by default. You can enabled it by adding the line define(’ENABLE_CACHE’, true); after define (’WPLANG’, ”);. So it will look like this:
define ('WPLANG', '');
Object cache may cause performance penalty when the available memory is low and too many Apache processes are allowed. With caching enabled each Apache process (or Thread), serving a WordPress page request, caches at most 124 php objects which can increase memory consumption.
As a result kswapd (swap manager) comes into play and at high loads it tends to swap too often and ends up consuming most of the CPU cycles itself instead of allowing actual processing.
So if you are on a low end machine with low RAM or if you are sharing the machine with lots of other users then you can experience performance issues. However you can easily solve it by either increasing the memory or reducing the maximum number of Apache processes you serve. In short object cache can be used to improve your performance.
Using compression on your web content enables you to serve your pages significcantly faster, even upto 7 times faster. You can turn on compression in your web server. In compressing php output with wp-cache2 wordPress plugin I explained how you can easily enable gzip compression on top on wp-cache 2 to further speed up your site.
If you do not have mod_deflate module activated and you cannot request your web hosting provider to do it for you then you have an alternative. You can use php compression by adding these lines to your .htaccess file in WordPress base directory:
php_flag zlib.output_compression on
php_value zlib.output_compression_level 2
I have tested them on this blog site and they do not conflict with wp-cache 2 plugin.
Use plugins judiciously
While we all have a tendency to add cool plugins when we find them, each comes with a cost. Any plugin serving dynamic content adds to your page processing time. When your site grows and you start getting more visitors you will feel the load on your server. So experiment with plugins but stick with the ones you really need.
With these tools in your arsenal you will be able to serve very high loads, even Digg effects, without breaking a sweat.