2

I'm using Docker with Ubuntu for my CI and development environment. I would like to put the database on a ramdisk partition to speed up the builds, since I have to reload my fixtures a lot, so data persistence isn't an issue here.

Is that possible? What steps I should add to my Docker file?

1 Answer 1

2

Here is excerpt from my post in the DBA StackExchange

RAMDISK_SIZE=32g
service mysql stop
mkdir /var/tmpfs
echo "none   /var/tmpfs  tmpfs  defaults,size=${RAMDISK_SIZE} 1 2" >> /etc/fstab
mount -t tmpfs -o size=${RAMDISK_SIZE} none /var/tmpfs
cp -R /var/lib/mysql/* /var/tmpfs
mv /var/lib/mysql /var/lib/mysql_old
ln -s /var/tmpfs /var/lib/mysql
chown -R mysql:mysql /var/tmpfs
chown -R mysql:mysql /var/lib/mysql
service mysql start

I hope you can apply it to Ubuntu

Give it a Try !!!

1
  • I used something along this lines, but I discovered that my DB data is so small (~10Mb) that I obtained no performance inprovement: all the DB files where always already on cache, hence already on RAM. Jan 31, 2015 at 16:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .