在构建服务器上使用 ramdisk 是否明智?
在我的公司,我们目前正在研究各种加速 CI 构建的策略。我们已经分析了我们的构建并确定我们受到 I/O 瓶颈的限制。在不久的将来(大约 1-2 个月),我们有很多选择来解决这个问题,但我们真的希望现在看到改进。
我建议使用 ramdisk 作为签出和构建文件位置。构建输出和日志当然会存储在物理磁盘上。
这是明智的做法还是这种方法有明显的缺点?我并不是在寻找有关硬件方面的答案,而是在寻找常见构建系统(例如 MSBuild)和 ramdisk 之间的交互是否会导致任何问题以及是否存在我需要注意的其他风险。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
只要你有足够的内存,这就是一件非常明智的事情。
当然,唯一真正的缺点是,您的构建会在关闭/电源故障时丢失,这对于 CI 构建来说通常不是一个大问题。
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.
我刚刚在我的“构建服务器”(实际上是一个 Powershell 脚本)上运行了一些测试,它从 Subversion 中检查了 3600 个文件,编译它们(DOT.NET)并运行一些单元测试。
在我的普通(不是超快)硬盘上,该过程需要 35 秒。
在 Windows 7 上使用默认 FAT32 设置的 Dataram RamDisk 工具需要 45 秒。
使用 NTFS 重新格式化可将时间缩短至 30 秒。
但使用 SSD(在我的例子中是 OCZ Vertex 2)只需要 27 秒。
我做了几次测试,但时间总是相同的。
我们可以从中学到什么?
Ram 磁盘并不总是更快,请确保使用不同的产品测试不同的产品
设置。
固态硬盘甚至可能比 RAM 磁盘更快,这让我感到惊讶。
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.