SSD时代的编程

发布于 2024-11-18 03:44:06 字数 270 浏览 4 评论 0原文

我想知道即将到来的 SSD 技术如何影响(大多数系统)编程。出现了大量问题,但这里有一些最明显的问题:

  • 磁盘访问速度是否可以被视为接近内存速度?
  • 如果不是,这是否只是一个临时状态,或者有一些根本原因导致 SSD 永远不会像 RAM 一样快?
  • B 树(及其近亲)仍然有用吗?
  • 如果是的话,是否对 SSD 的 B-Tree(B+-Tree、R-Tree 等)进行了任何调整或修改?如果没有,是否还有其他专为 SSD 设计的数据结构?

I am wondering how the oncoming SSD technology affects (mosty system) programming. Tons of questions arise, but here are some most obvious ones:

  • Can the speed of disk access be considered anywhere near to the memory speed?
  • If not, is it either just a temporary state, or there are some fundamental reasons why SSD won't ever be as fast as RAM?
  • Are B-Trees (and its cousins) still relevant?
  • If so, are there any adjustments or modifications of B-Trees (B+-Trees, R-Trees, etc.) made for SSD? If not, are there any other data structures crafted for SSD?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

半枫 2024-11-25 03:44:06

诚然,SSD 消除了读取的寻道时间问题,但在 SSD 上高效写入却相当棘手。我们一直在对这些问题进行一些研究,同时寻找将 SSD 用于 Acunu 存储核心的最佳方法。

您可能会发现这些有趣:

It is true that SSDs eliminate the seek time issue for reading, but writing efficiently on them is quite tricky. We have been doing some research into these issues while looking for the best way to use SSDs for the Acunu storage core.

You might find these interesting:

七月上 2024-11-25 03:44:06
  • 当前基于闪存的 SSD 的速度远不及主存 DRAM。非易失性内存技术最终会像 DRAM 一样表现吗?有一天。有许多有前途的技术正在开发中。
  • SSD性能的瓶颈之一是SATA接口。随着技术的进步,SSD将连接到DRAM或PCIe总线。
  • 只要内存访问是在块中执行的,B 树仍然相关。甚至 DRAM 也是按块访问的,而流行的块则缓存在 CPU 中。尽管实现起来很困难,但设计用于在 DRAM 中运行的 B 树可以胜过其他类型的易失性搜索树。然而,直到树中有数百万个条目时,性能优势才可能显现出来。
  • 为 SSD 实现的 B 树受益于块分配的改进。当前一代闪存 SSD 更喜欢顺序写入。随着 B 树的增长(或变化),应按顺序分配新块以获得最佳写入性能。基于日志的存储格式应该表现良好,但我还没有看到任何可扩展的实现。随着顺序写入和随机写入之间的性能差距缩小,分配顺序将变得不那么重要。
  • Current flash-based SSDs are not nearly as fast as main-memory DRAM. Will non-volatile memory technology eventually perform as well as DRAM? Someday. There's a lot of promising technologies under development.
  • One bottleneck in SSD performance is the SATA interface. As the technology improves, SSDs will be connected into the DRAM or PCIe bus.
  • B-trees are still relevant, as long as memory access is performed in blocks. Even DRAM is accessed in blocks, and popular blocks are cached in the CPU. Although difficult to implement, a B-tree designed to operate in DRAM can outperform other kinds of volatile search trees. The performance benefit will not likely be apparent until the tree has millions of entries in it, however.
  • B-trees implemented for SSDs benefit from improvements in block allocation. Current generation flash SSDs prefer sequentially ordered writes. As the B-tree grows (or changes), new blocks should be allocated in sequential order to get the best write performance. Log-based storage formats should do well, but I've not seen any implementations that scale. As the performance gap between sequentially and randomly ordered writes narrows, allocation order will become less important.
另类 2024-11-25 03:44:06
  1. RAM 不必记住重置/重新启动后的状态。我非常怀疑 SSD 是否会像 RAM 一样快。
  2. B 树仍然非常重要,因为您仍然尝试最小化磁盘读取。
  1. RAM doesn't have to remember state after reset/reboot. I highly doubt SSD will ever be as fast as RAM.
  2. B-Trees are still very much relevant as you still try to minimize the disk reads.
狂之美人 2024-11-25 03:44:06

很容易想到一个因素...

越来越多的趋势是将硬盘驱动器视为磁带驱动器,因为使磁头在相隔较远的磁道之间移动的相对成本较高。这导致人们努力优化数据访问模式,以便磁头可以在表面上平滑移动,而不是随机寻找。

SSD 实际上消除了寻道损失,因此我们可以不再太担心磁盘上数据的布局。 (更准确地说,由于磨损均衡问题,我们有一系列不同的担忧)。

One factor comes readily to mind...

There has been a growing trend towards treating hard drives as if they are tape drives, due to the high relative cost of making heads move between widely separated tracks. This has led to efforts to optimise data access patterns so that the head can move smoothly across the surface rather than seeking randomly.

SSDs practically eliminate the seek penalty, so we can go back to not worrying so much about the layout of data on disk. (More accurately, we have a different set of worries, due to wear-levelling concerns).

淡淡離愁欲言轉身 2024-11-25 03:44:06

虽然 SSD 的寻道时间比 HDD 的寻道时间快一两个数量级,但与 RAM 相比,这些时间仍然很重要。这意味着与寻道时间相关的问题没有那么严重,但仍然存在。吞吐量仍然比 RAM 低得多。除了存储技术之外,连接也很重要。 RAM 在物理上非常靠近 CPU 和主板上的其他组件,并使用特殊的总线。大容量存储设备不具备这个优势。存在电池支持的 RAM 模块包,可以充当超高速 HDD 替代品,但如果它们通过 SATA、SCSI 或其他典型磁盘接口连接,则仍然比系统 RAM 慢。

这意味着 B 树仍然很重要,为了获得高性能,您仍然需要注意 RAM 中的内容和永久存储中的内容。由于整个架构和物理限制(非易失性写入可能总是比易失性写入慢),我认为这种差距可能会变得更小,但我怀疑它在可预见的未来会完全消失。即使您查看“RAM”,您实际上也没有单一的速度,而是多个级别的越来越快(但更小且更昂贵)的缓存。因此,至少存在一些差异。

While the seek times of SSDs are better than those of HDDs by an order of magnitude or two, compared to RAM, these times are still significant. This means that issues related to seek times are not as bad, but they still are there. The throughput is still much lower than in RAM. Apart from the storage technology, the connections matter. RAM is physically very close to the CPU and other components on the motherboard and uses a special bus. Mass-storage devices don't have this advantage. There exist battery-backed packages of RAM modules which can act as an ultra-fast HDD substitute but if they attach via SATA, SCSI or other typical disk interface, the still are slower than system RAM.

This means that B-trees stil are significant and for high performance you still need to take care of what is in RAM and what is in permanent storage. Due to the whole architecture and physical limitations (non-volatile writes probably always will tend to be slower than volatile ones), I think this gap may become smaller but I doubt it will be completely gone in any foreseeable future. Even if you look at "RAM", you really don't have a single speed there, but several levels of faster and faster (but smaller and more expensive) caches. So at least some differences are there to stay.

半透明的墙 2024-11-25 03:44:06

我测试了 SSD 和 RamDisk 上的构建时间,SSD 更快一些。
我的同事使用完全不同的设置获得了相同的结果 - HDD 上的构建时间为 9 分钟,RamDisk 上的构建时间为 3 分 30 秒,SSD 上的构建时间为 3 分 0 秒。

I tested build time on SSD and RamDisk, SSD was a little faster.
Same result was achived by my coworker with entirely different setup - build time on HDD was 9 minutes, on RamDisk 3min 30sec, on SSD 3min 0sec.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文