收稿日期: 2024-07-04
录用日期: 2024-07-31
网络出版日期: 2024-09-23
基金资助
国家自然科学基金 (62072179)
Blocking analysis and scheduling strategy in transactions based on lock-avoidance
Received date: 2024-07-04
Accepted date: 2024-07-31
Online published: 2024-09-23
在现代教育环境中, 高效且可靠的数据管理系统对于在线教育平台和学生信息管理系统的运行至关重要. 随着教育数据量的持续增长和多用户访问频率的提高, 数据库系统面临并发冲突操作带来的高吞吐要求的挑战. 在众多并发控制策略中, 基于锁的控制策略是数据库系统中常用的策略之一, 然而, 由于锁造成的阻塞会影响数据库中事务并发执行的性能. 现有的工作主要通过调度事务间执行顺序或优化存储过程等方法减少锁竞争. 为了进一步提升事务吞吐, 本文基于锁避免进行事务内的阻塞分析和代价建模, 并提出事务内调度策略, 通过对工作负载的阻塞分析预估调度代价, 然后根据一定规则在事务内部有限程度地交换操作顺序, 减少锁阻塞造成的延迟, 从而提高性能. 最后, 通过对比传统的调度策略, 验证了提出的调度策略对吞吐的提升及对事务平均延迟的降低的效果.
凌向荣 , 翁思扬 , 张蓉 . 基于锁避免的事务内阻塞分析与调度策略[J]. 华东师范大学学报(自然科学版), 2024 , 2024(5) : 152 -161 . DOI: 10.3969/j.issn.1000-5641.2024.05.014
In the modern educational environment, efficient and reliable data management systems are essential for the operation of online education platforms and student information management systems. With the continuous growth of educational data and the increase in the frequency of multi-user access, database systems face the challenge of high throughput requirements owing to concurrent conflict operations. Among the many concurrency control strategies, the lock-based control strategy is commonly used in database systems. However, the blocking caused by locks affects the performance of concurrent execution of transactions in the database. Existing work mainly reduces lock contention by scheduling the execution order between transactions or optimizing stored procedures. To improve transaction throughput further, this study conducts blocking analysis and cost modeling within transactions based on lock avoidance, and proposes an intra-transaction scheduling strategy. The scheduling cost is estimated by analyzing the blocking of the workload, and then the operation order is exchanged to a limited extent within the transaction according to certain rules to reduce the delay caused by lock blocking, thereby improving performance. Finally, comparing the conventional and proposed scheduling strategies, the latter is verified to improve throughput and reduce the average transaction delay.
1 | BERNSTEIN P A, GOODMAN N.. Concurrency control in distributed database systems. ACM Computing Surveys (CSUR), 1981, 13 (2): 185- 221. |
2 | TIAN B, HUANG J, MOZAFARI B, et al.. Contention-aware lock scheduling for transactional databases. Proceedings of the VLDB Endowment, 2018, 11 (5): 648- 62. |
3 | THOMASIAN A, RYU I K.. Performance analysis of two-phase locking. IEEE transactions on software engineering, 1991, (5): 386. |
4 | YU X, BEZERRA G, PAVLO A, et al.. Staring into the abyss: An evaluation of concurrency control with one thousand cores. Proceedings of the VLDB Endowment, 2014, (3): 209- 220. |
5 | JONES E P, ABADI D J, MADDEN S. Low overhead concurrency control for partitioned main memory databases [C]// Proceedings of the 2010 ACM SIGMOD International Conference on Management of Data. 2010: 603-614 |
6 | GUPTA R, HARITSA J, RAMAMRITHAM K. Revisiting commit processing in distributed database systems [C]// Proceedings of the 1997 ACM SIGMOD international conference on Management of data. ACM SIGMOD Record, 1997: 486-497. |
7 | GUO Z, WU K, YAN C, et al. Releasing locks as early as you can: Reducing contention of hotspots by violating two-phase locking [C]// Proceedings of the 2021 International Conference on Management of Data. 2021: 658-670. |
8 | ALTMEYER S, SUNDHARAM S M, NAVET N. The case for FIFO real-time scheduling [R]. Luxemburg: Universit?t Augsburg, 2016. |
9 | HUANG J, MOZAFARI B, SCHOENEBECK G, et al. A top-down approach to achieving performance predictability in database systems [C]// Proceedings of the 2017 ACM International Conference on Management of Data. 2017: 745-758. |
10 | SHENG Y, TOMASIC A, ZHANG T, et al. Scheduling OLTP transactions via learned abort prediction [C]// Proceedings of the Second International Workshop on Exploiting Artificial Intelligence Techniques for Data Management, 2019. |
11 | WANG D, CAI P, QIAN W, et al. Predictive Transaction Scheduling for Alleviating Lock Thrashing [C]// Proceedings of the Database Systems for Advanced Applications: 25th International Conference, 2020, Jeju, South Korea. [S.l.]: Springer, 2020: 24–27. |
12 | WAGNER B, KOHN A, NEUMANN T. Self-tuning query scheduling for analytical workloads [C]// Proceedings of the 2021 International Conference on Management of Data. 2021: 1879-1891. |
13 | THOMSON A, DIAMOND T, WENG S-C, et al. Calvin: Fast distributed transactions for partitioned database systems [C]// Proceedings of the 2012 ACM SIGMOD International Conference on Management of Data, Scottsdale, AZ. |
14 | PRASAAD G, CHEUNG A, SUCIU D. Handling highly contended OLTP workloads using fast dynamic partitioning [C]// Proceedings of the 2020 ACM SIGMOD International Conference on Management of Data, Portland, OR. |
15 | QADAH T M, SADOGHI M. Quecc: A queue-oriented, control-free concurrency architecture [C]// Proceedings of the 19th International Middleware Conference. 2018. |
16 | YAO C, AGRAWAL D, CHEN G, et al.. Exploiting single-threaded model in multi-core in-memory systems. IEEE Transactions on Knowledge and Data Engineering, 2016, 28 (10): 2635- 2650. |
17 | LI J, LU Y, WANG Q, et al. AlNiCo: SmartNIC-accelerated contention-aware request scheduling for transaction processing [C]// Proceedings of the 2022 USENIX Annual Technical Conference (USENIX ATC 22), Carlsbad, CA. |
18 | WENG S, WANG Q, QU L, et al.. Lauca: A workload duplicator for benchmarking transactional database performance. IEEE Transactions on Knowledge and Data Engineering, 2024, 36 (7): 3180- 3194. |
19 | DIFALLAH D E, PAVLO A, CURINO C, et al.. Oltp-bench: An extensible testbed for benchmarking relational databases. Proceedings of the VLDB Endowment, 2013, 7 (4): 277- 288. |
20 | TPC. TPC-C benchmark [EB/OL]. [2024-05-29]. http://www.tpc.org/tpcc/. |
21 | BAINS S, HUANG J. Contention-aware transaction scheduling arriving in InnoDB to boost performance [EB/OL]. (2017-11-05)[2024-05-29]. https://dev.mysql.com/blog-archive/contention-aware-transaction-scheduling-arriving-in-innodb-to-boost-performance. |
/
〈 |
|
〉 |