TXSQL: Lock Optimizations Towards High Contented Workloads (Extended Version)

Fuente: arXiv
Guardado en:
Detalles Bibliográficos
Autores principales: Wang, Donghui, Chen, Yuxing, Jiang, Chengyao, Pan, Anqun, Jiang, Wei, Wang, Songli, Lei, Hailin, Zhu, Chong, Zheng, Lixiong, Lu, Wei, Chai, Yunpeng, Zhang, Feng, Du, Xiaoyong
Formato: Preprint
Publicado: 2025
Materias:
Acceso en línea:
Etiquetas: Agregar Etiqueta
Sin Etiquetas, Sea el primero en etiquetar este registro!
_version_ 1866912318214897664
author Wang, Donghui
Chen, Yuxing
Jiang, Chengyao
Pan, Anqun
Jiang, Wei
Wang, Songli
Lei, Hailin
Zhu, Chong
Zheng, Lixiong
Lu, Wei
Chai, Yunpeng
Zhang, Feng
Du, Xiaoyong
author_facet Wang, Donghui
Chen, Yuxing
Jiang, Chengyao
Pan, Anqun
Jiang, Wei
Wang, Songli
Lei, Hailin
Zhu, Chong
Zheng, Lixiong
Lu, Wei
Chai, Yunpeng
Zhang, Feng
Du, Xiaoyong
contents Two-phase locking (2PL) is a fundamental and widely used concurrency control protocol. It regulates concurrent access to database data by following a specific sequence of acquiring and releasing locks during transaction execution, thereby ensuring transaction isolation. However, in strict 2PL, transactions must wait for conflicting transactions to commit and release their locks, which reduces concurrency and system throughput. We have observed this issue is exacerbated in high-contented workloads at Tencent, where lock contention can severely degrade system performance. While existing optimizations demonstrate some effectiveness in high-contention scenarios, their performance remains insufficient, as they suffer from lock contention and waiting in hotspot access. This paper presents optimizations in lock management implemented in Tencent's database, TXSQL, with a particular focus on high-contention scenarios. First, we discuss our motivations and the journey toward general lock optimization, which includes lightweight lock management, a copy-free active transaction list, and queue locking mechanisms that effectively enhance concurrency. Second, we introduce a hotspot-aware approach that enables certain highly conflicting transactions to switch to a group locking method, which groups conflicting transactions at a specific hotspot, allowing them to execute serially in an uncommitted state within a conflict group without the need for locking, thereby reducing lock contention. Our evaluation shows that under high-contented workloads, TXSQL achieves performance improvements of up to 6.5x and up to 22.3x compared to state-of-the-art methods and systems, respectively.
format Preprint
id arxiv_https___arxiv_org_abs_2504_06854
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle TXSQL: Lock Optimizations Towards High Contented Workloads (Extended Version)
Wang, Donghui
Chen, Yuxing
Jiang, Chengyao
Pan, Anqun
Jiang, Wei
Wang, Songli
Lei, Hailin
Zhu, Chong
Zheng, Lixiong
Lu, Wei
Chai, Yunpeng
Zhang, Feng
Du, Xiaoyong
Databases
Two-phase locking (2PL) is a fundamental and widely used concurrency control protocol. It regulates concurrent access to database data by following a specific sequence of acquiring and releasing locks during transaction execution, thereby ensuring transaction isolation. However, in strict 2PL, transactions must wait for conflicting transactions to commit and release their locks, which reduces concurrency and system throughput. We have observed this issue is exacerbated in high-contented workloads at Tencent, where lock contention can severely degrade system performance. While existing optimizations demonstrate some effectiveness in high-contention scenarios, their performance remains insufficient, as they suffer from lock contention and waiting in hotspot access. This paper presents optimizations in lock management implemented in Tencent's database, TXSQL, with a particular focus on high-contention scenarios. First, we discuss our motivations and the journey toward general lock optimization, which includes lightweight lock management, a copy-free active transaction list, and queue locking mechanisms that effectively enhance concurrency. Second, we introduce a hotspot-aware approach that enables certain highly conflicting transactions to switch to a group locking method, which groups conflicting transactions at a specific hotspot, allowing them to execute serially in an uncommitted state within a conflict group without the need for locking, thereby reducing lock contention. Our evaluation shows that under high-contented workloads, TXSQL achieves performance improvements of up to 6.5x and up to 22.3x compared to state-of-the-art methods and systems, respectively.
title TXSQL: Lock Optimizations Towards High Contented Workloads (Extended Version)
topic Databases
url https://arxiv.org/abs/2504.06854