William Jiang

JavaScript,PHP,Node,Perl,LAMP Web Developer – http://williamjxj.com; https://github.com/williamjxj?tab=repositories

High Traffic Solutions

Here is a good article from: http://codex.wordpress.org/High_Traffic_Tips_For_WordPress about high traffic control, which I also added some of my comments.

W3 Total Cache

W3 Total Cache (W3TC) is the latest generation in WordPress performance plugins, which combines the research of web development authorities to provide an optimal user experience for WordPress sites. W3TC is unique in its ability to optimize server side and client side performance, adding functionality otherwise not natively available:

  • Page Caching: Similar to the plugins that came before it, W3TC can create static HTML versions of pages, so that the web server can serve them without invoking PHP (which decreases response time). It automatically updates the cache when comments are made or pages are edited.
  • Minify: Remove unnecessary characters from HTML, CSS and JavaScript files, then respectively combine them and apply HTTP compression on the cached files.
  • Database Caching: Database queries (objects) are also cached, allowing many sites to reduce the time to generate new pages; often an issue when a site receives lots of comments each day.
  • Headers: W3TC manages the headers (entity tag, cache-control, expires) which control the caching of files in web browsers – reducing server load and improving user’s perceived performance.
  • Content Delivery Network (CDN): Use a CDN to “offload” resources from your hosting account. W3TC moves the requests for images, CSS, JavaScript and other static files, to a network of high performance servers. Then, the server closest to the visitor is automatically used to download the files, providing the fastest downloads possible.
  • optimizing mysql and Apache settings

For one or more servers, no matter if shared or dedicated hosting, W3TC provides the options to fully optimize WordPress. Upon activation it starts working with safe default settings.

WP Super Cache

WP Super Cache is a (static) page caching plugin for WordPress. It generates html files that are served directly by Apache without processing comparatively heavy PHP scripts. By using this plugin you will speed up your WordPress blog significantly.

This plugin is a fork of the excellent WP Cache by Ricardo Galli Granada. WP Cache caches the pages of your WordPress blog and delivers them without accessing the database. Unfortunately it still requires loading the PHP engine to serve the cached files, so use of WP Cache is no longer recommended.

WP Super Cache gets around that. When it is installed, html files are generated and are served without ever invoking a single line of PHP. How fast can your site serve graphic files? That’s how fast it will be able to serve these cached .html files. If your site is struggling to cope with the daily number of visitors, or if your site appears on Digg.comSlashdot.org or any other popular site, then this plugin is for you.

Turn Off or Limit WordPress Plugins and Graphics

When the traffic increases on your WordPress blog, all aspects of your blog’s code and design elements also increase.

For example, let’s say the front page of your blog calls upon 8 graphics to create the “look” of your blog’s design. Add to this number the various WordPress template files it takes to build your page. You’ve got the header, sidebar, footer, and post content area at a minimum. That’s four more “calls” to files on your site. For 100 visitors, those files get loaded 1200 times. For 1000 visitors, those files are accessed and loaded 12000 times. This increases your bandwidth and server activity.

WordPress Plugins are also files that are “called” by your WordPress Theme. In turn, these make queries to your database to generate the information on your blog. The more WordPress Plugins, the more queries to your database. Combine all these access files and database queries with an exponential increase in visitors, and you have a lot of demand on your site.

You can lower the number of files accessed and the queries to your database during heavy traffic times by:

  1. limiting the number of graphics on your blog by editing the stylesheet and template files of your WordPress Theme.
  2. turning off a few WordPress Plugins temporarily. Go through your list of WordPress Plugins to see if there are any listed that you could live without for a day or two.

Keep the access to files and your database to a minimum as much as possible. After the heavy traffic volume has died down a bit, then you can reactivate and restore these features.

New Hosting

As painful as it may be to hear it, you might simply require a more powerful server.

Here is a simple outline of upgrade steps for a site that is having high-traffic problems. If you are having trouble with:

  • Shared hosting, try upgrading to Virtual Dedicated Hosting.
  • Virtual Dedicated Hosting, try upgrading to Dedicated Hosting.
  • Dedicated Hosting, try upgrading to a higher-powered dedicated server.
  • High-Powered Dedicated Hosting, it is time to talk with your host about multiple Load Balanced Servers.

In all cases, your server is only as capable as your network provider. If your provider does not provide the bandwidth you require, you may need to negotiate an increase with them, or find a different provider that can provide you with the bandwidth that your traffic requires.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: