Neil Turner's Blog

Blogging about technology and randomness since 2002

Movable Type is eating my database

Image Hosted by
Right now, my Movable Type database occupies well over half a gigabyte of space on my host’s web server – 550 MB, to be exact. Obviously, 6 years of blogging with all of its comments and entries does result in a lot of data, but can it really be this much?
The thing is, not that long ago the database was only around 50 MB – 11 times smaller. A tweet by Gregor was what prompted me to look – he’s a WordPress user and the auto-save and post revision functions that have been added recently have contributed to “massive bloat fail”, in his words. And it looks like Movable Type has the same problem – here’s a pie chart to demonstrate:

That big lump of hideous green is ‘session data’, which holds a variety of things but namely auto-saves of entries and templates. That alone is taking up 500 MB of data.
The problem is that MT doesn’t seem to have a ‘clean up session data’ option anywhere, nor did a cursory Google search turn up much information about it. I’d like to know if I can get rid of it, as right now more than a quarter of my hosting plan is now set aside to this session data. I’d be also interested to hear if any WordPress users are in the same boat since it too has this problem.


  1. As with everything WordPress, there is a plugin to disable these functions, but nothing to get rid of untold months of autosaves and now a month of post revisions (in the wikipedia style)
    My DB jumped from 6mb to around 300mb, not as crazy as your’s, but what I found incredible was the fact that WordPress stores all the dashboard RSS feeds *permanantly* in the options table (or at least they used to at one point and didn’t find a way to flush it), I had magpie information dating back to 2005/06

  2. Try this:
    cd MT_DIR; ./tools/run-periodic-tasks
    Even better, put it in your crontab… It’s like an apple a day for your MT installation.

  3. Doh! Thanks Jay, last time I updated MT I changed its folder so it wouldn’t have been running. Hopefully that will sort things but Brad Choate has also started a conversation with me on Twitter about it.

  4. Mine must be working correctly – my database is only 16mb in size. still thinking about moving it to wordpress, although its a frightening prospect of converting everything.

  5. So, are you saying that one of the things “run-periodic-tasks” does is clear old session data? (I don’t know perl so, looking at the code doesn’t do much for me in making it obvious)
    I have not found any info pertaining to session data and the “run-periodic-tasks” other than this post; everything points to using it for timed publishing.
    I tinkered around with logging in and viewing the session data in the session table. If I logged out the session is removed from the database but, if I did not log out and just closed the browser then the session data remained and it appears that it would accumulate over time, which I guess makes sense. However, I did the run-periodic-tasks and it had no effect on the session data so, what am I missing here?
    I apologize if I am missing something obvious but, I am still learning all of this. BTW, I am running 4.23. Thx.