Major WP issues – Options table exceeding 2+ gigabytes

Woke up this morning to a bunch of pingdom emails stating my site has been down. Turns out there’s either a security vulnerability with WP 2.7 or one of my plugins since my options table went from a few megs to over 2 gigs.

The excess size caused mysql to sh*% itself.

I can’t research the issue, since (mt) has locked the table and is researching the issue right now.

All I could do is recover a backup from an old backup to a new db then import the missing posts from the offending db. There’s still some quirks, like comments but it looks like intense debate figured out what to do there.

I’ll update this post when I figure this out. I sure hope it’s some bad code from a recent plugin update rather than a security issue. Regardless, I’ll need to look into this further.

About the Author, Dan Cameron:

I'm the owner and solution engineer at Sprout Venture, a web solutions company that specializes in web development including WordPress.

I started my first blog in 2003 and transitioned to WordPress in 2004. Since moving to WordPress I've written a few plugins and themes for public consumption. Lately I'm busy engineering/building/coding and have only been able to share a few code snippets.

If you're in need of some web development, web design or custom WordPress plugins and/or themes contact me, I'll be happy to discuss it with you.

Read More »

  • JaredB
    Interesting. Have you had any Apache or MySQL crashes or system restarts recently? I've seen this in those cases, but I think that's more likely to cause an interrupted write to the database than code in PHP (WP or its plugins); I can't actually think of any non-intentional way for that to happen from within the PHP code.



    Side note: Is it intense debate or your theme that makes it so comments don't show up if javascript is disabled? I take it that means that comments aren't indexed either?
  • JaredB
    Hmm. That's odd. I'm pretty sure that since you switched to Intense Debate comments never show up for me here unless I enable javascript.



    Oddly enough, that last comment you just made does show up on this post, but no others do, if I turn off javascript.
  • So it was definitely Intense Debate.

    Shortly after I contacted them about the issue they sent out a patch, that's why I'm sticking with them until I find something else wrong with their system that warrants me to go to the default wp comments. Their support has been great through this whole process so I almost feel obligated to give them another shot.

    Right now the comments on this post aren't in sync and I'm not counting on them to ever be, even though they assured me they would be.

    I'll just have to write another post and test the synching because all comments should be stored in both locations-no matter what.
  • Jared: PLEASE!! change your gravatar, it's so reminiscent of some teenage GIRL myspace/facebook photo.
  • aside: comments work without javascript. It’s just these comments somehow didn’t get synced to WP, or they’re not showing up because of the post id wonkyness on later posts from the recovery.
  • JaredB
    Wow, that is pretty big. I'd be interested to hear what you find out.



    I do remember finding at one point that the cached RSS items (the feeds WP pulls down to show in the dashboard) in the options table had gotten out of hand in one of my WP DBs. I don't think it was that big (so I'm guessing that's not the problem with yours), but it was a lot of wasted space I had to clear out.
  • dancameron
    Still unsure. MT has been great in their response to the issue and I'm not able to do a mysqldump to look at the raw data to see what the culprite was because mysql marked it as "crashed/corrupt".



    MT thinks and I have to believe that MySQL might have been interrupted during a write, probably as a result of bad code in WP 2.7 or a plugin. They also suggested InnoDB, which I'm contemplating changing.



    Otherwise, it could have been the result of some sort of compromise-even though my core and plugins have been up-to-date. I'll just need to keep an eye on my tables and if anything goes out of the ordinary I'll hopefully catch it in time.
  • Turns out IntenseDebate was the culprit.

    I noticed my options table this morning grow to >350mb, this time I was able to download the table and see ID was writing rows of logs for the sync that sends my comments to their servers.

    This would also explain why those recent comments weren't being synced and showing up when js was disabled. Since the comments where only being sent to their service and not written to my own comments table.

    I've disabled ID, I'm contemplating Disqus again but I'm uncertain if I want to use any comment service in the short term.

    I'll need to post about the two services: I wanted to like ID, but it's very buggy-as you can tell. Disqus was solid but the style was lacking.
  • aside: comments work without javascript. It's just these comments somehow didn't get synced to WP, or they're not showing up because of the post id wonkyness on later posts from the recovery.
blog comments powered by Disqus