Last Updated: February 25, 2016
·
392
· incognito

Make those long running I/O-intense jobs faster

Once in a while I need to run a task that involves a lot of IO on the disk. Computationally it's not very intense, but it keeps having to hit my physical disk and files system every time.

For example, if I want to re-write the history of a git repository using git filter-branch, run a code cleaner like phpcbf over a massive project.

So I mount a tempfs (which is a very fast file system stored in RAM) (lets assume I only need 1G of RAM)

mkdir /mnt/tmpfs
mount -o size=1G -t tmpfs none /mnt/tmpfs

Now simply put all your files into /mnt/tmpfs as needed and enjoy.

This will disappear after reboot, so be careful to copy over what you need when you are done. There are tools such as Anything Sync Daemon to help with this