Skip to content

WordPress slow, optimize your database

It seemed that one of my blogs was slowing down to a point where it was almost unusable. Trying to save or publish an entry would often lead to a connection timeout and loss of what I’d typed.

But, it was only one site. This one, also running WordPress, was slow but not to the level of my other blog. Fortunately, my thoughts went to the database server.

Pulling up the blog database in phpMyAdmin I found that several of the tables had overhead. One table, the one for a plugin called WP-StatTraq, was almost 20 megs. Being as I stopped using WP-StatTraq when I updated my theme, it seemed pointless to have that much data just taking up space. That table, along with the settings table for WP-StatTraq got the axe.

By far the biggest improvement came after I optimized / repaired all the tables. The site, both admin and visitor side, became downright snappy. Turns out, many of the tables had connections that had closed incorrectly and were causing problems. By closing those connections, it sped up the whole process. Of course, I had to go and do the same procedure on this site.

Now, the only task is to figure out a cron job to do this every week or so so that I don’t have to worry about it.

Published inBloggingProgramming

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *