作者投稿和查稿 主编审稿 专家审稿 编委审稿 远程编辑

计算机工程

• 体系结构与软件技术 • 上一篇    下一篇

基于哈希算法的脏数据回写磁盘实时调优策略

刘 志a,b,张 晶a,b   

  1. (昆明理工大学 a. 云南省计算机技术应用重点实验室;b. 信息工程与自动化学院,昆明 650500)
  • 收稿日期:2013-04-08 出版日期:2014-06-15 发布日期:2014-06-13
  • 作者简介:刘 志(1987-),男,硕士研究生,主研方向:实时嵌入式系统,数据挖掘,知识发现;张 晶(通讯作者),教授、博士。
  • 基金资助:
    云南省自然科学基金资助项目(2012FB137, 2011FZ060)。

Real-time Tuning Strategy of Dirty Data Writing Back to Disk Based on Hash Algorithm

LIU Zhi  a,b, ZHANG Jing   a,b   

  1. (a. Computer Technology Application Key Lab of Yunnan Province; b. Faculty of Information Engineering and Automation, Kunming University of Science and Technology, Kunming 650500, China)
  • Received:2013-04-08 Online:2014-06-15 Published:2014-06-13

摘要: 针对传统数据库缓冲池脏数据回写磁盘策略实时性与安全性差的问题,提出基于Hash算法与先入先出(FIFO)双向链表的数据库缓冲池脏数据回写磁盘实时调优策略。利用基于负载的调优策略创建多个内存FIFO队列链表,通过Hash算法将数据库缓冲区内的脏数据块按最后修改时间随机分配到不同队列负载中,实现FIFO队列链表的负载均衡,并利用全局时序约束将链表队列中的脏数据块分批回写磁盘,以解决传统脏数据回写磁盘策略系统资源消耗大与宕机后数据丢失风险高的问题。实验结果证明,该策略能提高脏数据回写的实时性及安全性,降低数据丢失率。

关键词: 脏数据块, 先入先出队列链表, 哈希算法, 缓冲池, 时序约束

Abstract: Aiming at the problem of low real-time performance and poor security during the period when the traditional database writes dirty data in the buffer pool back to disk, a database buffer pool real-time tuning strategy of dirty data writing back to disk is proposed in this paper on the basis of Hash algorithm and the First In First Out(FIFO) doubly-linked list. Multiple FIFO queue lists are created in the memory according to the tuning strategy based on workload, and the dirty data blocks in the buffer are randomly distributed in different lists by Hash algorithm according to their last modified time, in order to do load balancing across those FIFO queue lists. Meanwhile, the global timing constraints are built to help writing the dirty data blocks back to disk in batches to solve the problem of high resource consumption and high risk of data loss in downtime when adopting the traditional writing back strategy. Experimental results prove that this strategy can improve the real-time performance and security when writing back the dirty data, and reduce the loss rate of data.

Key words: dirty data block, First In First Out(FIFO) queue list, Hash algorithm, buffer pool, timing constraint

中图分类号: