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

2019-03-18 01:14发布

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.

2条回答
手持菜刀,她持情操
2楼-- · 2019-03-18 01:25

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.

查看更多
爷的心禁止访问
3楼-- · 2019-03-18 01:40

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.

查看更多
登录 后发表回答