摘要: 针对传统数据库缓冲池脏数据回写磁盘策略实时性与安全性差的问题,提出基于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
中图分类号: