On 03/24/2011 06:49 PM, Cody Robertson wrote:
On 03/24/2011 06:32 PM, Arnau Bria wrote:
Hi again,


I'm cleaning my DB (which was 15GB) following:
https://github.com/puppetlabs/puppet-dashboard

I did:

rake RAILS_ENV=production reports:prune upto=1 unit=wk
rake RAILS_ENV=development reports:prune upto=1 unit=wk

(It has been running for about 3 months)

and after:

rake RAILS_ENV=production db:raw:optimize
rake RAILS_ENV=development db:raw:optimize

It has removed lots of entries, but it's still 15GB.

Am I doing something wrong? why is it not decreasing its size?


TIA,
Arnau

This is because the dashboard uses InnoDB tables. You'll probably have a huge `ibdata` file in /var/lib/mysql/ somewhere. It's a known bug but the `ibdata` file grows but doesn't shrink.

http://bugs.mysql.com/bug.php?id=1341

I'd suggest making MySQL use a different file per *.ibd file as it makes it easier to see which table is the culprit. From there you should be able to figure out a way to have the files re-created once you've pruned them (albeit no "good" way that I know of).

http://dev.mysql.com/doc/refman/5.0/en/innodb-multiple-tablespaces.html


Just to clarify - InnoDB should re-use that space in the ibdata file until it needs more at which point it'll increase the size. This is why it's important to run the cleanup jobs fairly frequently. You can also set the max size of the files I believe.

Here's some information (it looks like they mention a procedure to shrink existing ibdata files that aren't fully used as well): http://dev.mysql.com/doc/refman/5.0/en/innodb-data-log-reconfiguration.html

--
Cody Robertson
1-800-859-8803 ext. 5

--
You received this message because you are subscribed to the Google Groups "Puppet 
Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to