WordPress and my slow MySQL database issue is solved!

Posted By on November 20, 2011

Finally, after about a month of trial and error fiddling with WordPress and MySQL since moving to a new server, redirectionlogsforwpI’ve figured out why MyDesultoryBlog has been so slow. Initially I blamed the new server since everything was fine at the old host, and even started to wonder if 6 years or so of daily blogging had finally hit a limit for “my” particular install or memory allocation. The experts that I talked with were all over the board and really not of much help – the same for searching, reading and posting on the WordPress  support forums.

redirectionpluginFinally after clearing out a few log files I looked at the plugin for handling 301 redirection and keeping track of 404 errors … “hmm, I was building up a pretty good sized log record.” The plug-in responsible for managing this is called  Redirection and has a manual log deletion button. After who knows how many months … years probably … of building a substantial sized log, I finally deleted it (I could have emptied directly from MySQL, but the plug in button make it easy).

So my advice, if you are noticing database query slowness, and have already “repaired” and “optimized” your database, is to clear out any unneeded log files … especially the one being created by the Redirection plug-in … if you have it installed. Also under the “Options” link be sure to set the “Expire Logs” for something other than zero.

setexpiredfor7days

Comments

  • Ah yes, much snappier. Not quite static HTML fast, but good for a PHP based site. ;-]

    • Thanks … I should have expected the “static html” wisecrack from you. Happy Thanksgiving!

      • On the plus side, you can update your site from anywhere. My software is not “in the cloud” and firewall’d behind my router. Hence no updates when I’m on business travel unless I open up a port in the router. Who knows, maybe someday I’ll buy a tiny instance in Amazon EC2 and run from there…
        I AM getting tempted by DISQUS though. Seeing it more and more and it looks like it’s maturing into a stable comment management system.

        • Yes, so far so good with DISQUS. It does add one
          more layer of “slowness” but I do like the way it handles
          comments.  As for your HTML posting, I looked into a service that blends WP with static pages on Amazon’s servers but couldn’t come up with a free option. I think that would be a great opensource project?

          As for your posting when away, could you VPN to home and do your updates?

          EDIT COMMENT: The first reply was from GMail’s web email … the second reply from Thunderbird client in HTML email which doesn’t post correctly to DISQUS — reply in “plain text only” mode.

          • Yes, VPN or an SSH tunnel. I’ve been thinking about leveraging the latter with something like VNC or RDP.
            (Enough acronyms in one comment?!)
            It’s all just a matter of finding the time… Perhaps over the four day weekend…

Desultory - des-uhl-tawr-ee, -tohr-ee

  1. lacking in consistency, constancy, or visible order, disconnected; fitful: desultory conversation.
  2. digressing from or unconnected with the main subject; random: a desultory remark.