Support » How-To and Troubleshooting » [Resolved] Database usage is out of control

[Resolved] Database usage is out of control

  • I started tracking my database storage and I’ve found that it’s getting out of hand. My provider only allows 100MB storage per database and as of right now, I am hovering around 35MB, depending on how many people are accessing our site. It seems that we’re getting around half a meg for each post we create and we average around 2 a day. At this rate, our database will be full by April.

    Is it normal for a post to command that much space?

    I use Disqus for our comments system, could this be the culprit?

    Is there any way to use two databases for one wordpress blog?

    I know the ultimate solution is to use a dedicated server, but >$50 a month seems steep considering I’m using much cheaper hosting and not really making money with the site yet. Any suggestions on ways to help this issue would be much appreciated it.

Viewing 11 replies - 1 through 11 (of 11 total)
  • Moderator Mark Ratledge


    Forum Moderator

    Try cleaning your database of post revisions, plugin options that aren’t used anymore, and log files for plugins like Disqus, and see if Disqus has an option to limit revisions. And then optomize the database using phpmyadmin. You might be able to shrink the database size by half. Backup your databse before you do anything.

    Run as SQL query in phpmyadmin to delete revisions:

    DELETE a,b,c
    FROM wp_posts a
    LEFT JOIN wp_term_relationships b ON (a.ID = b.object_id)
    LEFT JOIN wp_postmeta c ON (a.ID = c.post_id)
    WHERE a.post_type = 'revision'

    You can add to wp-config.php to stop revisions and autosave:

    define ('WP_POST_REVISIONS', FALSE);
    define('AUTOSAVE_INTERVAL', 6000);

    or select the number of revisions to keep:
    define('WP_POST_REVISIONS', 3);

    And check the plugins you use to see if they have added tables to your database for log files that you don’t really need.

    Use Clean Options « WordPress Plugins to clean old plugin options.

    I stopped the revisions for posts using a plug in, but I’ll check and see about Disqus to see if it’s adding too many revisions.

    I have the Clean Options Plug-In but I’m not certain what I’m supposed to be looking for here. Should I just use the Delete All option? Will all of my options repopulate afterwards?

    I’m sorry, but I’m still figuring out how all of this works…

    Moderator Mark Ratledge


    Forum Moderator

    Match up the plugins you currently use with the options you see. Don’t delete options for a plugin you use, or you will have to reset the plugin options. Docs: http://www.mittineague.com/dev/co.php

    Old options are going to be a problem in database size, but more than likely it’s *tables* added by plugins which Clean Options isn’t going to do anything about.

    Did you delete *old* revisions? Simply disabling revisions doesn’t clean out the revisions already in the databse.

    The plug in I used to disable revisions also cleared out the old revisions, which allowed for around 8MB to be freed up. But that was back when my database usage was in the 20s.

    There certainly seems to be a lot of stuff in the WP_Options section, I’ll see what I can find there.

    Moderator Mark Ratledge


    Forum Moderator

    Do you have any more DB tables than the standard 11? http://codex.wordpress.org/Database_Description#Table_Overview

    there is one for a stats program that has about 900 lines. I’ve just been nervous about blasting away an entire table. If it’s just for a plug in, what are the chances it will bring my whole site down if I remove it? lol

    Moderator Mark Ratledge


    Forum Moderator

    What’s the size of the table? Which stats plugin?

    I don’t have access to the size as of this moment, but the plug in was something like “bb stats plug in.” I don’t remember the exact name.

    Moderator Mark Ratledge


    Forum Moderator

    That’s probably the size problem….

    Well, I found the culprit. I use Pro Player to have our podcasts embedded on our webpages. There is a function of Pro Player called “Playlists” and this is sitting at 36MB and climbing… I’m seeing what I can do about it. Thanks for your help but I think now it’s up to the writer of Pro Player to determine how to resolve this.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘[Resolved] Database usage is out of control’ is closed to new replies.