Optimize your server for high traffic WordPress installation

If you run a high traffic WordPress installation you will want to optimize WordPress and your server to run as efficiently as possible. This article gives a general overview of the avenues to pursue. It’s not a detailed technical explanation of each aspect.

WordPress Logo

The optimization techniques available to you will depend on your hosting setup. This article is divided into categories according to hosting type.

1) Shared Hosting :

This is the most common type of hosting. Your site will be hosted on a server along with many others. The hosting company manages the web server for you, so you have very little control over server settings and so on. The areas most relevant to this type of hosting are :

  • Caching : WordPress caching is the fastest way to improve performance. Plugins like W3 Total Cache or WP Super Cache can be easily installed and will cache your WordPress posts and pages as static files. These static files are then served to users, reducing the processing load on the server. This can improve performance several hundred times over for fairly static pages.
  • WordPress Performance : The first and easiest way to improve WordPress performance is plugins. Deactivate and delete any unnecessary plugins. Try selectively disabling plugins to measure server performance. Is one of your plugins significantly affecting your site’s performance?
    Then you can look at optimizing plugins. Are plugins coded inefficiently? Do they repeat unnecessary database queries? WordPress has its own caching system, so generally speaking, using functions like get_option(), update_option() and so on will be faster than writing SQL.

2) Virtual / Dedicated Server :

In this hosting scenario you have control over your own server. The server might be a dedicated piece of hardware or one of many virtual servers sharing the same physical hardware. The key thing is, you have control over the server settings. In addition to the areas above Caching and WordPress performance, you can follow the below techniques to optimize your server :

  • Server Optimization :

    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.

    Web Server: Your web server can be configured to increase performance. There are a range of techniques from web server caching to setting cache headers to reduce load per visitor. Search for your specific web server optimizations (for example, search for “apache optimization” for more info).

    PHP: There are various PHP accelerators available which can dramatically improve performance of your PHP files. This will apply to all PHP files, not just your WordPress installation. Search for PHP optimization for more information, f.e. APC.

    MySQL: MySQL optimization is a black art in itself. A few simple changes to the query cache settings can have a dramatic effect on WordPress performance because WordPress repeats a lot of queries on every request. Search for mysql optimization for more.

  • Offloading :

    Static Content : Any static files can be offloaded to another server. For example, any static images, JavaScript or CSS files can be moved to a different server. This is a common technique in very high performance systems (Google, Flickr, YouTube, etc) but can also be helpful for smaller sites where a single server is struggling. Also, moving this content onto different hostnames can lay the groundwork for multiple servers in the future.Some web servers are optimized to serve static files and can do so far more efficiently than more complex web servers like Apache, for example publicfile or lighttpd.

    Multiple Hostnames : There can also be user improvements by splitting static files between multiple hostnames. Most browser will only make 2 simultaneous requests to a server, so if you page requires 16 files they will be requested 2 at a time. If you spread that between 4 host names they will be requested 8 at a time. This can reduce page loading times for the user, but it can increase server load by creating more simultaneous requests. Also, known is “pipelining” can often saturate the visitor’s internet connection if overused.

    Offloading images is the easiest and simplest place to start. All images files could be evenly split between three hostnames (assets1.yoursite.com, assets2.yoursite.com, assets3.yoursite.com for example). As traffic grows, these hostnames could be moved to your own server. Note: Avoid picking a hostname at random as this will affect browser caching and result in more traffic and may also create excessive DNS lookups which do carry a performance penalty.

    Likewise any static JavaScript and CSS files can be offloaded to separate hostnames or servers.

Source : http://codex.wordpress.org

3 ways to make dynamic pages load faster

Dynamic websites are easier to manage and often more content driven than the old static websites from the early days of the web. With that dynamic nature, however, comes a greater amount of security risk and a greater need for hands-on management beyond the initial development, especially with content-heavy sites like blogs. Speed becomes a big factor because the server must load the scripts and often fetch data from a database in a timely manner. The following are 3 tips that should help you speed up your dynamic website.

1. Caching
The concept of caching is simple, but it can have a profound effect on page loading speed. The most used items, whether pages themselves or images, are stored in a cache for easier access. When a client calls up a page that has not been changed recently, the server does not have to access the database again and run any scripts. It simply loads the page from the cache. You can find caching plugins for content management systems like WordPress, often for free.

2. Optimize Design
In most cases, talking about website design falls out of the realm of web hosting management, but in this case, the way your site is designed directly affects how fast it is. If your CSS pages, Javascript, and scripting code are all well optimized, your site will be faster.

3. Content Delivery Network
A content delivery network (CDN) is a service that allows you to host images, media, and even your CSS files on remote servers that quickly and dynamically serve up the content to your users. A good CDN will have a large number of diverse geographic locations so that it can get content to users faster. It will also reduce loads on your own server, which in turn speeds it up.

There are many other ways to speed up your blog or other dynamic websites, but the aforementioned three should get you on the right track. Always remember that any system you implement could have consequences on the speed and performance of your site, so plan accordingly.

Source: http://www.thehostingnews.com