Using Storage Class Memory Efficiently for an In-memory Database

Yonatan Gottesman, J. Nider, Ronen I. Kat, Y. Weinsberg, M. Factor
{"title":"Using Storage Class Memory Efficiently for an In-memory Database","authors":"Yonatan Gottesman, J. Nider, Ronen I. Kat, Y. Weinsberg, M. Factor","doi":"10.1145/2928275.2933273","DOIUrl":null,"url":null,"abstract":"Storage class memory (SCM) is an emerging class of memory devices that are both byte addressable, and persistent. There are many different technologies that can be considered SCM, at different stages of maturity. Examples of such technologies include NVDIMM-N, PCM, SttRAM, Racetrack, FeRAM, and others. Currently, applications rely on storage technologies such as Flash memory and hard disks as the physical media for persistency. SCM behaves differently and has significantly different characteristics than these existing technologies. That means there is a need for a fundamental change in the way we program data persistency in applications to fully realize the potential of this new class of device. Previous work such as [1] focuses on designing a filesystem optimized to run over SCM memory. Other projects such as Mnemosyne [4] provide a general purpose API for applications to use SCM memory. Mnemosyne however, does not provide a transaction mechanism flexible enough to allow different SCM updates spanning different parts of the code to be considered one transaction. Our work is focused on employing minimal changes needed to retrofit an existing key-value store to take advantage of SCM technology. We demonstrate these changes on Redis (REmote DIctionary Server) [3], which is a popular key-value store. We show how Redis can be modified to take advantage of these new abilities by allowing the application to manage its own storage in a unique way. Our approach is to use two types of memory technologies (DRAM and SCM) for different purposes in a single application. To optimize the system data capacity, we keep a minimal dataset in persistent memory, while keeping metadata (such as indexing) in DRAM, which can be rebuilt upon failures. Persistency in Redis is currently performed by logging all transactions to an append-only log file (AOF). These transactions can then be replayed to recover from a failure. The transactions are not made persistent until the AOF file is flushed to disk, which is very slow. Flushing after every transaction has a performance impact, but flushing periodically creates a risk of lost data. By using SCM instead of a disk, we can effectively flush every transaction without impacting performance. In order to change Redis to store data objects on the SCM, we must ensure consistency of persistent data even after an unexpected shutdown. To ensure consistency, a modified version of dlmalloc [2] is used for all allocations done on the SCM, and mfence commands are used to overcome unexpected reordering. We model the SCM using a memory mapped file backed on a ramdisk. We compared our changes to Redis using an AOF backed on a ramdisk. Although we don't take into account the latency overheads of accessing the SCM, this comparison gives us a good upper bound of performance benefits of using SCM memory. Our results demonstrate an average latency reduction of 43% and average throughput increase of 75%.","PeriodicalId":20607,"journal":{"name":"Proceedings of the 9th ACM International on Systems and Storage Conference","volume":"31 1","pages":""},"PeriodicalIF":0.0000,"publicationDate":"2016-06-06","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"13","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Proceedings of the 9th ACM International on Systems and Storage Conference","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/2928275.2933273","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 13

Abstract

Storage class memory (SCM) is an emerging class of memory devices that are both byte addressable, and persistent. There are many different technologies that can be considered SCM, at different stages of maturity. Examples of such technologies include NVDIMM-N, PCM, SttRAM, Racetrack, FeRAM, and others. Currently, applications rely on storage technologies such as Flash memory and hard disks as the physical media for persistency. SCM behaves differently and has significantly different characteristics than these existing technologies. That means there is a need for a fundamental change in the way we program data persistency in applications to fully realize the potential of this new class of device. Previous work such as [1] focuses on designing a filesystem optimized to run over SCM memory. Other projects such as Mnemosyne [4] provide a general purpose API for applications to use SCM memory. Mnemosyne however, does not provide a transaction mechanism flexible enough to allow different SCM updates spanning different parts of the code to be considered one transaction. Our work is focused on employing minimal changes needed to retrofit an existing key-value store to take advantage of SCM technology. We demonstrate these changes on Redis (REmote DIctionary Server) [3], which is a popular key-value store. We show how Redis can be modified to take advantage of these new abilities by allowing the application to manage its own storage in a unique way. Our approach is to use two types of memory technologies (DRAM and SCM) for different purposes in a single application. To optimize the system data capacity, we keep a minimal dataset in persistent memory, while keeping metadata (such as indexing) in DRAM, which can be rebuilt upon failures. Persistency in Redis is currently performed by logging all transactions to an append-only log file (AOF). These transactions can then be replayed to recover from a failure. The transactions are not made persistent until the AOF file is flushed to disk, which is very slow. Flushing after every transaction has a performance impact, but flushing periodically creates a risk of lost data. By using SCM instead of a disk, we can effectively flush every transaction without impacting performance. In order to change Redis to store data objects on the SCM, we must ensure consistency of persistent data even after an unexpected shutdown. To ensure consistency, a modified version of dlmalloc [2] is used for all allocations done on the SCM, and mfence commands are used to overcome unexpected reordering. We model the SCM using a memory mapped file backed on a ramdisk. We compared our changes to Redis using an AOF backed on a ramdisk. Although we don't take into account the latency overheads of accessing the SCM, this comparison gives us a good upper bound of performance benefits of using SCM memory. Our results demonstrate an average latency reduction of 43% and average throughput increase of 75%.
在内存数据库中有效地使用存储类内存
存储类内存(SCM)是一种新兴的内存设备,它既是字节可寻址的,又是持久的。在不同的成熟阶段,有许多不同的技术可以被认为是SCM。这些技术的例子包括NVDIMM-N、PCM、stram、Racetrack、FeRAM等。目前,应用程序依赖于存储技术,如闪存和硬盘作为持久性的物理介质。与这些现有技术相比,单片机的行为方式和特点有很大的不同。这意味着我们需要从根本上改变应用程序中数据持久性的编程方式,以充分发挥这类新设备的潜力。以前的工作,如[1]侧重于设计一个优化的文件系统,以便在SCM内存上运行。其他项目如Mnemosyne[4]为应用程序使用SCM内存提供了一个通用的API。然而,Mnemosyne并没有提供足够灵活的事务机制来允许跨代码不同部分的不同SCM更新被视为一个事务。我们的工作集中在利用SCM技术对现有的键值存储进行改造所需的最小更改上。我们在Redis(远程字典服务器)[3]上演示了这些变化,Redis是一个流行的键值存储。我们将展示如何修改Redis以利用这些新功能,允许应用程序以独特的方式管理自己的存储。我们的方法是在单个应用程序中为不同的目的使用两种类型的内存技术(DRAM和SCM)。为了优化系统数据容量,我们在持久内存中保留最小的数据集,而在DRAM中保留元数据(如索引),可以在故障时重建。Redis的持久性目前是通过将所有事务记录到一个仅追加的日志文件(AOF)来执行的。然后可以重放这些事务以从故障中恢复。在AOF文件被刷新到磁盘之前,事务不会被持久化,这是非常慢的。在每个事务之后进行刷新会对性能产生影响,但定期刷新会造成数据丢失的风险。通过使用SCM而不是磁盘,我们可以在不影响性能的情况下有效地刷新每个事务。为了改变Redis在SCM上存储数据对象,我们必须确保持久数据的一致性,即使在意外关机之后。为了确保一致性,在SCM上完成的所有分配都使用修改版本的dlmalloc[2],并且使用mfence命令来克服意外的重新排序。我们使用存储在ramdisk上的内存映射文件对SCM进行建模。我们使用备份在ram磁盘上的AOF将我们的更改与Redis进行了比较。虽然我们没有考虑访问SCM的延迟开销,但这种比较为我们提供了使用SCM内存的性能优势的一个很好的上限。我们的结果表明,平均延迟减少了43%,平均吞吐量增加了75%。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信