Tuesday, December 17, 2013

Resetting database state for functional testing

Use mysqlhotcopy and just copy the files back.

It's a testing server.  We know nothing's happening except the tests.  So (for MyISAM) we can just copy the files and flush tables.

Using a mysqldump style restore was taking ~40 secs.

Copying files is taking ~1.5 seconds.  And I suspect most of that is the time spent by phing and to establish an ssh connection - the actual copying directly on the server takes no time at all.

This won't work like this for InnoDB (when we get to that point).  I'll need, I think, either to work out a filesystem (LVM) snapshot approach, or use Percona Xtrabackup.


No comments:

Post a Comment