Do you have a slow or sluggish web site or blog? I’m going to give you 5 things you should check that can help quite a bit. Also – I’ll have a few tips specifically for WordPress sites.

In my previous post about importing large mySQL databases I showed you how to use the command line to import to get big data dumps in a fresh database. In that particular situation I was moving from one web host to another. But sometimes you might have a different reason for wanting to move a web site to a new database.

I’ve had web sites before that seemed to get slower over time. There are a number of factors that could be causing this. If you notice your web site taking longer to load, becoming sluggish, or even producing random errors (like ‘mySQL server went away’), there are some things you should investigate.

Here’s a list of things to think about:

  1. Are you getting more traffic? Check your stats for your site and see if you’ve had a sudden spike in traffic. If you are where is it coming from? Is it coming from a particular article or page? Is it from just one referrer or many? Is a robot or crawler hitting your site too much?
  2. Do you have too many external calls? When your site loads in a brower, watch the bottom status bar to see (while it loads) where it’s hanging up and waiting for data to come back. Do you have items from Amazon, eBay, other affiliate sites, chiclets, technorati tags, mybloglog data, feedburner calls, or other items that come from outside your site? Try commenting them out one by ond and seeing how much faster your page loads
  3. Are your graphics optimized?? Do you have any graphics on your pages that are excessive in size? Are you calling any graphics on remote sites that you could host in your site? Do all you graphics contain a height and width tag?
  4. Have you optimized your database? A web site database gets thousands of transactions per day. Think of it like a moving piece of machinery – at one time or another something will break or get clogged up. Every now and again you should login to your web admin control panel and use your myPhpAdmin (or other mySQL tool) to optimize your db. Select all the tables, and then “repair” and “optimize” and watch the results to see what it did. You would be surprised how well this trick might work.
  5. Is your web or database server overloaded? This can be a tricky one to figure out. If you don’t have telnet access, you need to call support for your web host and find out what the CPU and memory utilization is for the server you’re on. If it’s really high you may want to request to be moved to a new one. Most companies monitor this, so more than likely it could be your database mySQL server. Your myPHPAdmin tool might already have a tab or tool to bring up the server memory utilization, so you can see how high it is. If it’s not high, find out if your web host has a limit on concurrent connections (some limit to 150 or less) and watch your visitors per hour. Many times though, there are a just a few web sites hogging all the resources on a db server

If you have a WordPress site, I would also additionally check your WP theme and your WP plugins. First – remove any plugins that you aren’t using. Deactivate them and physically delete them from your web server. I read once that even deactivated plugins affect the speed of a site because the WordPress loop checks to see if they are activated or not. If you have plugins you specifically don’t need or use – get rid of them. You want your plugin page in the admin panel to have only plugins that are essential to your blog and they should all be active. If they aren’t – delete them from the server until you need them. Also, check your theme if you don’t write your own. Validate the code at W3C or another site and make sure that there aren’t major errors that are slowing the browser down. Just because you have a nice looking theme, (if you didn’t code it yourself) it doesn’t mean that the coder that made it had the most efficient code. If you have a lot of errors – maybe you should consider reworking it or just plain get another theme.

In my particular instance I thought I had my mySQL database hosted on a server that was too busy. At my host they have multiple database servers and when you create a new one it’s assigned at random. So I created a new fresh database – and of course it was on a different server. Then I exported my web site using myPHPAdmin, and I was going to import it in the fresh database using myPHPAdmin as well. But as it turned out my SQL file was 11MB, and some of the INSERT rows were very, very long. The import failed. But as I mentioned before – it was easy enough to use BigDump large mySQL db database import script for free to do the heavy work for me. In seconds I had a brand new copy of my site on another database server. So I changed my config file, and was up and running on another server quickly. In my situation this new server seemed to perform a bit better than the old one.

If you’ve experienced your web site or blog (especially WordPress) getting slow, bogged down, or getting random errors – try my list above first. If you’ve found your own solution, or experienced a problem that you can’t fix – please add it in the comments below now!