Performance analysis of locking policies with limited wait depth
Abstract
The performance of a transaction processing system with the standard two-phase locking (2PL) concurrency control (CC) method (with the general waiting policy upon a lock conflict) may be degraded significantly due to transaction blocking in a high lock contention environment. In the limit this effect leads to the fhrashing phenomenon, i.e., the majority of the transactions in the system become blocked. Limiting the wait depth of blocked transactions is an effective method to increase the number of active transactions in the system and to prevent thrashing, but this is at the cost of additional processing due to transaction restarts. The no-waiting (or immediate restart) policy limits the wait-depth to zero, while cautious waiting and the running priority policies use different methods to limit the wait depth to one. A variant of the wait depth limited (WDL) policy [8] also limits the wait depth to one, while attempting to minimize the wasted processing incurred by transaction aborts. A unified methodology to analyze the performance of the 2PL CC method with limited wait depth policies in a system with multiple transaction classes is described in this paper. The analysis is based on Markov chains representing the execution steps of each transaction in isolation, but as affected by hardware resource and data contention with other transactions in the system. Since the transition rates of the Markov chain are not known a priori, an iterative solution method is developed, which is then applied to the running priority and WDL policies. Simulation is used for validating the accuracy of the approximate analytic solutions. Of interest are the conservation laws governing the rate at which locks are transferred among transactions, which can be used to verify the correctness of the analysis.