BP-Wrapper: A System Framework Making Any Replacement Algorithms (Almost) Lock Contention Free

Xiaoning Ding, Song Jiang, Xiaodong Zhang
{"title":"BP-Wrapper: A System Framework Making Any Replacement Algorithms (Almost) Lock Contention Free","authors":"Xiaoning Ding, Song Jiang, Xiaodong Zhang","doi":"10.1109/ICDE.2009.96","DOIUrl":null,"url":null,"abstract":"In a high-end database system, the execution concurrency level rises continuously in a multiprocessor environment due to the increase in number of concurrent transactions and the introduction of multi-core processors. A new challenge for buffer management to address is to retain its scalability in responding to the highly concurrent data processing demands and environment. The page replacement algorithm, a major component in the buffer management, can seriously degrade the system's performance if the algorithm is not implemented in a scalable way. A lock-protected data structure is used in most replacement algorithms, where high contention is caused by concurrent accesses. A common practice is to modify a replacement algorithm to reduce the contention, such as to approximate the LRU replacement with the clock algorithm. Unfortunately, this type of modification usually hurts hit ratios of original algorithms. This problem may not exist or can be tolerated in an environment of low concurrency, thus has not been given enough attention for a long time. In this paper, instead of making a trade-off between the high hit ratio of a replacement algorithm and the low lock contention of its approximation, we propose a system framework, called BP-Wrapper, that (almost) eliminates lock contention for any replacement algorithm without requiring any changes to the algorithm. In BP-Wrapper, we use batching and prefetching techniques to reduce lock contention and to retain high hit ratio. The implementation of BP-Wrapper in PostgreSQL version 8.2 adds only about 300 lines of C code. It can increase the throughput up to two folds compared with the replacement algorithms with lock contention when running TPC-C-like and TPC-W-like workloads.","PeriodicalId":278393,"journal":{"name":"2009 IEEE 25th International Conference on Data Engineering","volume":"5 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2009-03-29","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"9","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"2009 IEEE 25th International Conference on Data Engineering","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/ICDE.2009.96","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 9

Abstract

In a high-end database system, the execution concurrency level rises continuously in a multiprocessor environment due to the increase in number of concurrent transactions and the introduction of multi-core processors. A new challenge for buffer management to address is to retain its scalability in responding to the highly concurrent data processing demands and environment. The page replacement algorithm, a major component in the buffer management, can seriously degrade the system's performance if the algorithm is not implemented in a scalable way. A lock-protected data structure is used in most replacement algorithms, where high contention is caused by concurrent accesses. A common practice is to modify a replacement algorithm to reduce the contention, such as to approximate the LRU replacement with the clock algorithm. Unfortunately, this type of modification usually hurts hit ratios of original algorithms. This problem may not exist or can be tolerated in an environment of low concurrency, thus has not been given enough attention for a long time. In this paper, instead of making a trade-off between the high hit ratio of a replacement algorithm and the low lock contention of its approximation, we propose a system framework, called BP-Wrapper, that (almost) eliminates lock contention for any replacement algorithm without requiring any changes to the algorithm. In BP-Wrapper, we use batching and prefetching techniques to reduce lock contention and to retain high hit ratio. The implementation of BP-Wrapper in PostgreSQL version 8.2 adds only about 300 lines of C code. It can increase the throughput up to two folds compared with the replacement algorithms with lock contention when running TPC-C-like and TPC-W-like workloads.
BP-Wrapper:一个使任何替换算法(几乎)免于锁争用的系统框架
在高端数据库系统中,由于并发事务数量的增加和多核处理器的引入,多处理器环境下的执行并发性水平不断提高。缓冲区管理需要解决的一个新挑战是在响应高度并发的数据处理需求和环境时保持其可伸缩性。页面替换算法是缓冲区管理中的一个重要组成部分,如果不以可扩展的方式实现该算法,则会严重降低系统的性能。在大多数替换算法中使用锁保护的数据结构,其中并发访问导致高争用。一种常见的做法是修改替换算法以减少争用,例如用时钟算法近似地替换LRU。不幸的是,这种类型的修改通常会损害原始算法的命中率。这个问题在低并发环境中可能不存在或可以容忍,因此长期以来没有得到足够的重视。在本文中,我们没有在替换算法的高命中率和其近似的低锁争用之间进行权衡,而是提出了一个称为BP-Wrapper的系统框架,它(几乎)消除了任何替换算法的锁争用,而不需要对算法进行任何更改。在BP-Wrapper中,我们使用了批处理和预取技术来减少锁争用并保持高命中率。PostgreSQL 8.2版本中BP-Wrapper的实现只增加了大约300行C代码。在运行类似tpc - c和类似tpc - w的工作负载时,与具有锁争用的替换算法相比,它可以将吞吐量提高两倍。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约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学术文献互助群
群 号:604180095
Book学术官方微信
小红书