Skip to content

Instantly share code, notes, and snippets.

@sweikenb
Last active December 22, 2015 22:19
Speedup your symfony2 vagrant box by mounting the app/cache folder into the ram of the vm (run this script as root!)
#!/bin/sh
# create mount point
if [ ! -d /ram ]
then
mkdir /ram
fi
# create ramfs
mount -t ramfs -o size=512M ramfs /ram/
# remove existing cache
if [ -d /var/www/app/cache ]
then
rm -rf /var/www/app/cache
fi
# make shure we got the cache-dir for the symlink
if [ ! -d /ram/cache ]
then
mkdir /ram/cache
fi
# set proper user (you may need to modify this!)
chown -R www-data:www-data /ram
# link ram-cache into app
ln -s /ram/cache /var/www/app/cache
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment