Cleaning Your LAMP – Troubleshooting Slow CMS Issues


Do you manage a Content Management System (CMS) like Drupal, Joomla, or WordPress to run your website? Is it running slow, and your pages take a long time to load even though you have a high-speed connection? Well, I had some performance issues, and learned quite a lot in drilling down for some solutions. I’ll share that process with you here, one that most WebMasters and BlogMasters can use regardless of the CMS you have. We’ll take a closer look at some LAMP (Linux, Apache, MySQL, PHP) solutions. Then, I’ll give you a specific example of the final stage of troubeshooting for the WordPress CMS and conclude with some advice for you if you run a different system.

Connection & Server Issues…

First, you have to make sure that the perceived slowness of your website does not have to do with your ISP. It’s possible, you see, that you might have a DSL hookup that is faulty or moving quite slow. You also have to check that the server where your website is hosted is not running slow.

Here are the first steps I took.

  • Rule out ISP problems. This involved both a local program to monitor my connection (phone DSL), and also use of network-tools.com ping/trace route tool to make sure the route from my computer to my web server showed normal hop times in miliseconds (your hosting provider should help interpret this).
  • Check the Load on your server. My VPS (Virtual Private Server) is located with other VPS’s on one dedicated server. Part of my problem was the load caused by a different company on the same server. A good host will report that to you and offer you options. My host moved me to a different server. My VPS is located with other VPS’s on one dedicated server. Part of my problem was the load caused by a different company on the same server. A good host will report that to you and offer you options. My host moved me to a different server.

Ok. If you can rule out ISP problems and server problems (which could relate to hardware or software issue), it’s time to move down the troubleshooting path to four more steps. Hopefully you are working with a good, honest (and available) hosting company that will be able to spot and correct any server issues.

Cleaning your LAMP…

Are you familiar with the LAMP stack? We’re going to talk about solutions for Open Source CMS website issues here (specifically slow page load issues), and most run on the LAMP architechture — that’s LINUX for the operating system, Apache as a web server, MySQL for your database, and PHP as the program that makes things happen at your websites. Sometimes, Perl or Python programming languages are substituted for the “P” in LAMP, but PHP is still the major player, so we’ll concentrate on that here.

Go ahead and open all four links for the LAMP architecture given above, and take a good look around each site. As an “OpenSource WebMaster” you need to be familiar with these key resources, and they may just help you out of a big problem or two when you learn about all the references available at those sites.

Let’s take a quick look at how these key software programs work together to create the “LAMP” platform (or “stack”) on which your CMS will run:

All of the above components of your LAMP stack are software programs that are routinely upgraded and must work well in concert to create a platform to run your CMS. In each program, there are tweaks possible (“cleaning your LAMP”) which can improve your overall system performance. Some of these components have their own components like the ZEND engine that is part of the latest PHP versions (5.2.x) and which may give you a speed boost.

I have had 4-5 instances of slow performance of my WordPress 2.3.x sites running on a Virtual Private Server — all have relatively low traffic, but were loading pages slowly. They are running much faster as I write this. I will give you a list of things that have been done/ruled out in process of elimination troubleshooting, followed by a screenshot with the PluginHog Detector plugin for WordPress, then some thoughts on troubleshooting the final step (checking for problems with add in programs) in other CMS programs.

  1. LAMP stack issues. Is anything going on with, or is there a tweak to Linux, Apache, MySQL, or PHP that might help? Three things we tried here: One of my Host Techs (get a good hosting company — a “Linux House” — with smart techies, and make them your friend), made a tweak to cause “MySQL databases to close faster.” We also upgraded to the current version of PHP — PHP 5.2.4. The jury is out on whether PHP upgrade (many hosts prefer PHP 4.x ) helps, but some people believe the ZEND engine included with version 5.X of PHP can help speed things up a bit.PHP Cache: It turns out, if you’re running a WordPress site, there a couple of things you can do with “caching” to improve site performance. I tried this trick — a quick PHP edit to tell WordPress to cache database queries — which I got over at Elliott Back’s blog (thanks Elliott). You add the following to your wp-confi.php file:
    // Enable the WordPress Object Cache:
          define(ENABLE_CACHE, true);

    Mr. Back has some other suggestions at his blog which may be helpful for the WordPress BlogMaster — take a look, in particlular at his “PHP OpCode Cache” technique at that link. Note that I could have classified this under “WordPress Issues”, but the idea of looking at a cache fix using PHP is generic, and probably will work across a range of applications and Content Management Systems.

  2. WordPress CMS Issues. Here I am talking about the main program, which I do NOT believe causes any slowness, but I have seen some posts around the web that claim it creates a lot of MySQL drain. You can try loading a plugin for WordPress, called WP-Cache — which many users say will speed up your user experience.
  3. Plugin Issues in WordPress. Plugins are add-on programs written by third parties that work with WordPress. Here, is where I believe many of you will find solutions to your slow CMS sites. At my WordPress CMS websites, I suspected a couple of plugins were slowing my sites down (I use over 12 plugins at a couple of sites), but in the busy rush of things, I could not “prove” it. This is where the PlugInHog Detector Plugin can help us. I am going to finish this step with a comparison of the table generated when I click on a post at WebHelperMagazine.com, to a table generated with I click on the Tag Cloud (it is a plugin — “Configurable Tag Cloud”). You will see that the load takes much longer after a click on a tag cloud link:So… as you might guess, I thought the Configurable Tag Cloud widget might be the culprit. Guess what? I was using version 1.0 of the plugin, while version 2.3 was the newest. The plugin was out of date, but I did not know that because it is not maintained in the official WordPress plugin directory and so there was no update alert for it in the WordPress Admin. area (WordPress 2.3 and above can alert you to key plugin updates). Updating that plugin, along with the other steps seems to have cured my slow loading page(s) problem.

What about sites that run programs other than WordPress?

Your troubleshooting logic would be the same, but when you get to step 2 & 3, you will have to find a different way to examine your CMS, and any add-on programs (on Joomla they are called “extensions,” while on Drupal they are “modules”) you are using. I found these reference links for you:

  • JOOMLA: Joomla Performance BB (other boards there too)ยท
  • DRUPAL: Drupal Post Installation Forum (other Forums there too).
  • Other CMS: Visit their home site, hunt through their forums and bulletin boards, and don’t forget a good old GOOGLE search on “slow page load solutions” for your CMS.

Lessons Learned — Summing it all up…

Rule out ISP, and hosting server issues. Work with a good hosting provider’s support team. “Clean” your LAMP stack by upgrading to the most recent stable versions of the software, and tweaking relevant code to make the site run faster. Learn about the speed issues for your CMS and any add-on programs, then test your site (load and reload pages), update your add-on programs, and test the site again. Good Luck.

About the Author: Scott Frangos is a web developer, college instructor and graphic designer. He is Managing Partner at WebFadds.com, a web development firm specializing in WordPress Content Management Websites. He lives in Portland, Oregon with wife and partner, Pepper, and their three dogs: Wisdom, Spirit, & Steggman.

Comments are closed.