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.
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.
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.
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With