How do I prevent WordPress from overloading my shared server?

WordPress blogs can be extremely resource intensive if you happen to experience a surge in traffic. Poorly implemented WordPress setups can place a high load on webservers and lead to interruptions of service or account suspensions for using too many resources. At WebSouls we allow up to 10% of CPU resources and up to 50 concurrent mysql connections.

Here are some tips that can help you make your WordPress install more stable:

- Use WordPress super cache plugin as the number one thing you can do to improve WordPress performance is install a page cache. WordPress super cache plugin is an extensive modification of the WP-Cache plugin. The WordPress super cache plugin serializes your posts to a file on disk and later spits them back. It also knows how to update itself when comments are received, so your site is always the most up to date. This plugin ensures a stable and responsive wordpress install.

To use this plugin you must have Mod_Rewrite enabled. Add the following to your .htaccess file: Options +FollowSymLinks RewriteEngine On

- WP Built-in object cache is the default installation of WordPress and can be used to cache database queries. Less database queries = less resources being used. Add the following line to your wp-config.php file: // Enable the WordPress Object Cache: define(ENABLE_CACHE, true);

- You should review the plugins you have installed and see if there is a way to make them faster. Anyway in which you can make them stop creating database queries and use flat files, or even better, cache things, will help out greatly. If you find that a particular plugin is slowing down your WordPress install you should uninstall the plugin and consult the author. Most plugin developers love to hear feedback and would greatly appreciate your help.

- If you are doing media-rich applications and serving large files you may want to consider hosting these files on a WebSouls dedicated server.

- Keep your WordPress install up to date.

These points are only recommendations, a major spike in traffic may still take down a site even if it is cached. If you find your site is going down due to traffic, then it is likely that your site has outgrown shared hosting and it may be time to upgrade to a dedicated server.

=====================================================================================

 

 

WordPress Super Cache

 

Makes WordPress Faster

Introduction

WP Super Cache is a static 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 2 by Ricardo Galli Granada. WP-Cache 2 caches the pages of your WordPress blog and delivers them without accessing the database. Unfortunately it still means loading the PHP engine to serve the cached files.

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

Pay what you want!

WP Super Cache is a free plugin but donations are gladly accepted. Go on, drop a Dollar in my PayPal donation box! I also have an Amazon Wishlist too if you€™re feeling particularly generous.

Download and Install

  • Remove any existing instances of WP Cache, as WP Super Cache is a drop in replacement. Don€™t forget to delete the files wp-content/advanced-caching.php and wp-content/wp-cache-config.php. Also comment out the WP_CACHE define in wp-config.php.
  • Download the newest version of the WP Super Cache plugin and follow the instructions contained in the readme.txt file. If you have installed WP-Cache before this shouldn€™t be any more difficult.
  • After installation, go to the WP Super Cache options page and set your desired cache time.

How it works

A classic method of preparing an under powered site for a Digg front page appearance or a Slashdotting has been to manually save copies of dynamically generated pages, and place them in directories that match the permalinks structure. This method of performance enhancement does help servers handle a higher load without crashing, but is only effective when an oncoming rush of traffic can be anticipated. WP-Cache alone, while helpful, is not adequate in many cases, so WP Super Cache was created to effectively mimic the manual page caching method, but to handle it in an automated fashion.

When a visitor who is not logged in, or who has not left a comment, visits they will be served a static HTML page out of the supercache subdirectory within the WordPress cache directory. If you navigate to that directory you can view an exact replica of your permalink structure as well as the HTML files within the directories.

To determine if a page has been cached, view the source and the last lines on the page should read something like



You€™ll only see the last line if compression is enabled.

If you have compression enabled it is no longer possible to determine which cache the page was served from without looking at the page headers. Pages served from the WP-Cache €œhalf on€ cache will have an extra header.

WP-Super-Cache: WP-Cache

There are many ways of viewing the headers.
With compression disabled, the text will be displayed at the end of the page if the page is served from the static Supercache.

Use ismyblogworking.com to check if compression is working properly. It will also show just how fast your blog is now.

Features

  • A plugin and hooks system. A common complaint with WP Cache was that hacking was required to make it work nicely with other plugins. Now you can take advantage of the simple plugin system built in to change how or when pages are cached. Use do_cacheaction() and add_cacheaction() like you would with WordPress hooks. Plugins can add their own options to the admin page too.
  • Works well with WordPress MU in VHOST or non-VHOST configuration. Each blog€™s cache files are identified to improve performance.
  • Normal WP-Cache files are now split in two. Meta files go in their own directory making it much faster to scan and update the cache.
  • Includes this WP-Cache and protected posts fix.
  • Automatically disable gzip compression in WordPress instead of dying.
  • As Akismet and other spam fighting tools have improved, the cache will only be invalidated if a comment is definitely not spam.
  • A €œlock down€ button. I like to think of this as my €œDigg Proof€ button. This basically prepares your site for a heavy digging or slashdotting. It locks down the static cache files and doesn€™t delete them when a new comment is made.
  • Supercache static files can be regenerated while serving a slightly out of date file. This will significantly lower the load on a busy server with lots of traffic and comments. Think of it as an automatic €œlock down mode€ for every page on your site.
  • Automatic updating of your .htaccess file. (Backup your .htaccess before installing the plugin!)
  • Don€™t super cache any request with GET parameters.
  • Better version checking of wp-cache-config.php and advanced-cache.php in case you€™re using an old one.
  • Better support for Microsoft Windows.
  • Properly serve cached static files on Red Hat/Cent OS systems or others that have an entry for gzip in /etc/mime.types.
  • The Reject URI function now uses regular expressions.
  • Supports the Bad Behaviour plugin if installed (Half on mode only).
  • Supports plugins that show a different theme to mobile devices.

Caveats

  • If you€™re logged in or have left a comment you€™ll never see a super-cached page. You€™ll see plain old regular WP-Cached pages instead. That€™s not so bad since a huge majority of your visitors will never leave a comment.
  • Mod Rewrite is used to serve the static HTML pages. As fancy permalinks is also a requirement it should already be installed.
  • Some of the more dynamic aspects of your site€™s template won€™t refresh quite as quickly. For example, recent comment sidebar plugins. Those plugin should use Javascript to load their content instead.
  • Some sites have problems serving compressed html files and need extra configuration.
  • Don€™t expect a cheap hosting plan to survive a major traffic spike, even if it is cached!
  • Remember that dynamic content such as that within the sidebar, will only refresh when the cached pages are refreshed. This timeout value can be modified, but cached files will only be removed if you have a healthy mix of static and dynamic requests.
  • Some plugins like SK2 and others that depend on €œfresh€ data may not work very well, at least until those plugins support this plugin and clear the cache when required.

Performance Benchmarks

Benchmarks coming soon, but under high load, serving static html files will always trump dynamic PHP requests.

WP Super Cache has also been tested under real world load conditions. The following articles appeared on the Digg front page without issue while running WP Super Cache:

  • 29 Users Found This Useful
Was this answer helpful?

Related Articles

How to Prevent Wordpress Hacking

These are 10 Tips To Increase Wordpress SecurityIn recent years there has been a proliferation of...

What is Wordpress?

WordPress is an open source blog tool and publishing platform powered by PHP and MySQL. It is...

How to Manually Install WordPress in Parallel Plesk Panel?

Installing WordPress manually in Parallel Plesk Panel allows for greater customization and...

How to reduce wordpresss server load on shared hosting

For everyone of you, who use wordpress as a platform with shared hosting for his/her blog will...

How to install Wordpress manually

Step 1: Download the installation file from the WordPress download section by clicking on...