Home > Linux > tmpfs, speed up your day

tmpfs, speed up your day

Heres another oldie I transplanted, 

I don’t know about you but at work I do spend a fair enough time waiting for source to build. However I have a small trick that I’d figure to share. Building source in a <tmpfs> is extremely fast.   Your working strictly from volatile memory, never touching the spindle on your pc. This is a great solution for those with SATA hard drives “non-ssd”  and they have small portions of code they want to build rather quickly!  Anyways give this a whirl.Create a directory anywhere on the filesystem.#mkdir dir1

Now mount that directory into memory.

#mount -t tmpfs -o size=5g tmpfs dir1

What this command is instructing the OS to do is mount the directory we just created to tmpfs. If by any chance that specific job exceeds 5GB then it will die.

It’s very important that you don’t exceed your available free memory. If so, then you will start to cache off of the disk drive. Which can cause the build to take an extremely long time to complete. So be careful!

It’s a pretty nifty trick just thought I’d post.

— L8r

Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: