WordPress Hosting Environment

Contact

A WordPress hosting environment should be fast and scalable as  WordPress is a script built using PHP scripting language and it’s storing the data in a MySQL database. Both PHP and MySQL are open source so this is a quite common web development combination and many other popular open source and commercial scripts are also using the same setup. WordPress, using PHP and MySQL, enables us to have dynamic content which means we can easily make changes in one place and it’ll automatically be reflected on multiple areas of our website or easier storing of the data using a relational database such as categories, tags, dates, etc. If you have a website with multiple static (only HTML) pages and you need to change or organize something differently and you have 100 pages you would need to make the same change 100 times.

This also meany if you have a website with multiple static pages the site will usually load faster as there is nothing to process in the background. So while PHP and MySQL help us to have a dynamic website they also put a burden on the server performance and while for a small website this will not be a problem the more popular the website the more dynamic requests it’ll receive and need to process. The server needs to have sufficient hardware power to be able to process this of course and once we have sufficient hardware power we can additionally optimize the server with some additional software tools to quickly process the requests which will end up in a optimized WordPress hosting environment.

Why is speed important?

It’s a well known fact users leave a website if it loads slowly. You don’t want to make a great website with quality content and when someone comes to visit they wait for long periods for your great content to load and hit the back button in the process to go to another website. Also page loading times are very important for search engines and having a slow loading website will have a negative impact on your search engine rankings.

Once we’ve cleared out why speed is important and the factors important for this to be realized lets go into the hosting environment I would recommend.

DNS

If you host your DNS on external servers this will reduce the load on your primary web server. It’s a simple change, but it will offload some traffic and CPU load so use an external DNS provider.

HTTP Server

HTTP Server is a program  that provides HTTP services which responds to incoming tcp connections and provides a service to the caller. HTTP Server optimized for WordPress should be a secure, efficient and extensible server app with emphasis on high performance so it should be able to handle a number of requests in the most efficient manner.

Three popular HTTP servers:
– Apache – the first and probably the most popular open source HTTP server
– LiteSpeed – commercial high-performance, high-scalability web server
– Nginx – a free, open-source, high-performance HTTP server and reverse proxy

Nginx is a web server I would recommend as it’s proven to handle millions of requests and a lot faster than Apache.

Alternative PHP Cache

Alternative PHP Cache is a free, open source (PHP license) framework that optimizes PHP intermediate code and caches data and compiled code from the PHP bytecode compiler in shared memory. Install APC so you can do object, database and output caching with the help of W3 Total Cache (covered later).

There are alternatives here such as using Varnish but I haven’t really looked into this as of yet.

MySQL optimization

I will not go into how to optimize MySQL as that’s an article on its own but this is something that’s pretty important.

Content Delivery Network

A content delivery network or content distribution network (CDN) is a system of computers containing copies of data placed at various nodes of a network. Use a CDN to serve web objects (text, graphics, URLs and scripts), downloadable objects (media files, software, documents), applications, etc. It is a network of distibuted computers on multiple locations sharing your set of data from the computer the closest to the location the request is coming from so it’s faster for the visitor.

W3 Total Cache

W3TC is the best and by far the most extensive WordPress optimization and caching plugin which you configure to utilize the tools described mentioned in this article.

Conclusion

For busy websites this is something that’ll hopefully come in handy. For an e-commerce site having slow loading times will result in lost sales and this is something that should be addressed with proper hosting environment and of course hosting provider. Take a look at the presentation provided by Mark Jaquith (WP core lead developer) on how to scale WP environments.