Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it sensible to use a ramdisk on a build server?

At my company we are currently researching various strategies for speeding up our CI builds. We have profiled our builds and determined that we are constrained by an I/O bottleneck. We have quite a few options to deal with that in the near future (~1-2 months) but would really like to see an improvement now.

I proposed using a ramdisk as the checkout and buildfile location. The build outputs and logs would of course be stored on physical disk.

Is that a sensible thing to do or are there significant drawbacks to this approach? I am not looking for answers that regard the hardware side of things but rather than if the interaction between common build systems (e.g. MSBuild) and a ramdisk will cause any issues and if there are other risks I need to be aware of.

like image 457
Johannes Rudolph Avatar asked Aug 09 '10 16:08

Johannes Rudolph


People also ask

Should I use RAM disk?

RAM Disks are really only ideal if you're using a program that doesn't normally use RAM as cache, and if you don't care about losing the files stored on the RAM disk.

What is the purpose of RAM disk?

A RAM disk serves one purpose: to make I/O process performance faster and more efficient. Because RAM is the fastest type of storage, it makes sense to use it for storing data and programs so that they can be run and accessed faster.

Is RAM disk volatile?

The key characteristic to remember about a RAM Disk is that it is volatile memory; if power is lost, all the data is lost, so you have to use it wisely.

In what situations would using memory as a RAM disk be more useful than using it as a disk cache?

11.1 In what situations would using memory as a RAM disk be more useful than using it as a disk cache? Ans : In cases where the user (or system) knows exactly what data is going to be needed. Caches are algorithm-based, while a RAM disk is user-directed.


2 Answers

As long as you have enough memory, it's a very sensible thing to do.

The only real drawback is, naturally, your build gets lost on shutdown/power failure which usually isn't a big concern for the CI builds.

like image 154
nos Avatar answered Oct 17 '22 04:10

nos


I just ran some tests on my "build server" (actually a Powershell script) which checks out 3600 files from Subversion, compiles them (DOT.NET) and runs some Unit Tests.

On my normal (not super fast) hard drive the process takes 35 sec.

Using the Dataram RamDisk tool with the default FAT32 setup on Windows 7 is takes 45 sec.

Reformatting it with NTFS brings that down to 30 sec.

But using an SSD (in my case a OCZ Vertex 2) only takes 27 sec.

I did several test runs but the times are always the same.

What can we learn from this?

A Ram disk is not always faster, make sure you test different products with different settings.

A Solid State Drive may even be faster than a RAM disk, which surprised me.

like image 45
Peter Hahndorf Avatar answered Oct 17 '22 02:10

Peter Hahndorf