Turbocharge your WordPress Site
WordPress is one of the most popular content management systems (CMS) in use today. As a business owner, content publisher or web site developer getting the best performance from your WordPress site will be important to you. Increasing performance encourages visitors to return and engage more with your content or services.
Every WordPress site needs a host, and selecting the right hosting partner has always been a key starting point to success. Our VMware VPS Hosting solutions for Linux are built on the industry leading VMware ESXi & vSphere virtualization platform. WEB24’s VMware VPS Hosting offers the highest level of stability and performance available for virtualized environments.
But no matter how powerful your VPS hosting solution is, the key to real performance is fine-tuning the software stack makes up your WordPress site. There are many parts of the stack including the Apache web server, MySQL database, PHP, server side caching and WordPress itself that can all be adjusted so as to get the best performance possible. This article will show you how to optimise WordPress for your VPS or Dedicated Server.
MySQL has been proven to be a fast and scalable relational database platform and there’s no reason why it can’t drive large, highly trafficked WordPress sites.
Enable the Query Cache
One of the best ways to speed up your web application is to enable query caching in your database, which caches commonly used SQL queries in memory for virtually instant access by the next page that makes the same request.
This will make sure that MySQL is doing as little work as possible, freeing up resources for more important things than redundant queries.
You can learn more about the query cache via the MySQL support site: http://dev.mysql.com/doc/refman/5.1/en/query-cache.html
Use MySQL Tuner
MySQLTuner is a script written in Perl that allows you to review a MySQL installation quickly and make adjustments to increase performance and stability. The current configuration variables and status data is retrieved and presented in a brief format along with some basic performance suggestions.
You can learn more about the MySQLTuner script at:
Switching to the InnoDB engine
For high traffic sites switching to InnoDB as the default storage engine for MySQL may improve performance. You won’t compromise any native WordPress functionality by making the switch, however the performance gains will vary and are dependant on how many read and writes are being committed to the database. MySQL 5.5 and later now use InnoDB by default.
You can learn more about the InnoDB engine via the MySQL support site: https://dev.mysql.com/doc/refman/5.5/en/innodb-introduction.html
Using an alternative MySQL distribution
For very large scale enterprise level WordPress sites you could also look to using an alternative MySQL distribution to provide you with more power and scalability.
Percona Server 5.6 has features designed to match capabilities only available to purchasers of MySQL 5.6 Enterprise Edition. If features like Sharding, Read Replicas and Advanced Clustering are appealing to you then Percona Server may be the right database platform to scale with as your needs grow.
You can learn more about Percona Server at their web site: http://www.percona.com/software/percona-server/ps-5.6
Your WordPress database stores all of your website content. This includes blog posts, pages, comments, and custom post types such as links, form entries, and portfolio items. It also stores website settings, theme settings, and plugin settings.
If you update your website regularly, your database will grow larger over time. A large database can greatly affect the performance of your website as it takes longer for your server to retrieve information from database tables.
To learn more about how to optimise your WordPress database go to: http://premium.wpmudev.org/blog/optimizing-your-wordpress-database-a-complete-guide/
There are many different types of caching, including web page caches, hardware caches, software caches and memory caches. Caches are used to speed up a process so that data does not have to be recomputed or fetched from its original location and, therefore, saves time.
In the context of WordPress there are a variety of caches that can be implemented, that help to speed up PHP execution (opcode caching), commonly used objects or data (object caching), entire pages (page caching) and previously visited pages stored in your visitors web browser (browser caching).
You should review all these forms of caching to see which combination yields the best performance results for your WordPress site.
Like many other modern web applications, WordPress is written in a popular scripting language called PHP. Web pages written with PHP require the web server to run through the contents of the script and execute it each time it is viewed. With thousands of visitors potentially arriving to your site this process can be a potential bottleneck.
A PHP accelerator such as Alternative PHP Cache (APC) will help to reduce server overhead in processing PHP code by caching previous requests and thereby avoid the parsing and compiling of PHP source code each and every time a page is visited.
APC also offers an object cache, allowing objects you create to be stored in memory right next door to the scripts that need them. The only drawback to this level of caching is that it’s local to each respective application server you have.
You can learn more about the PHP APC Accelerator at:
Page Caching is a service that allows dynamic web page content to stored and generated as static HTML files. Popular pages are retrieved from the page cache and not generated dynamically from the WordPress database each time a visitor arrives. This provides a considerable improvement in performance particularly if you have hundreds or thousands of visitors arriving each day.
All HTTP requests made by the browser are first routed to the browser cache to check if there is a valid cached response that can be used to fulfill the request. If there is a match, the response is read from the cache and we eliminate both the network latency and the data costs incurred by the transfer.
Leveraging the browser’s cache is one of the biggest performance wins available and be easily implemented either via your web site’s .htacces file or through the use of a third party caching plugin such as W3 Total Cache or WP Super Cache.
Minification is vital to improving end user experience. Reducing the file size and number of files, and there the number of HTTP requests has a dramatic impact on a visitors experience with your site.
When making a selection, ensure you pick one that caches the minified files to disk, respects the differences between templates, supports local and remote files and most importantly is compatible with popular content delivery networks and mobile plugins.
Reverse proxies often provide caching that sits between the web application and the public Internet. Its goal is to lighten the load on the web servers behind them. Reverse proxies are optimized for returning content generated by the underlying application. Varnish, Nginx or even Apache can be configured to provide reverse proxy functionality.
Reverse Proxies are a more advanced form of caching as they usually require another server to be configured that acts as the proxy. For a small scale WordPress site with a low amount of traffic this may not be a feasible option, however for very large sites this technique will increase performance considerably and ease the load of your main web server.
For an Apache based configuration running cPanel/WHM you can implement a reverse proxy using the mod_proxy Apache module.
Content Delivery Network
A content delivery network or content distribution network (CDN) is a large distributed system of servers deployed in multiple data centers across the Internet. The goal of a CDN is to serve content to end-users with high availability and high performance.
With a CDN, it doesn’t matter where your site is hosted. If you have visitors in other parts of the world, the CDN caches that content close to them and shaves seconds off of the total page load time for your site.