Method and apparatus for self-tuning transaction batching
First Claim
Patent Images
1. A method for efficiently batching transactions in a computerized system, comprising the steps of:
- receiving a transaction at the computerized system;
writing the received transaction data to a data buffer;
if the received transaction is an only transaction in the computerized system, then flushing the data buffer to a non-volatile storage device;
if the received transaction is not the only transaction in the computerized system, then determining whether a maximum response time will be met for an oldest transaction waiting for flush in the computerized system if the data buffer were flushed to the storage device immediately;
if the maximum response time will not be met, then flushing the data buffer to the non-volatile storage device;
if the maximum response time will be met, then determining whether a rate of data of incoming transactions is higher than a rate of flushing data from the data buffer to the non-volatile storage device if flushed immediately;
if the rate of data of incoming transactions is lower than the rate of flushing data from the data buffer to the non-volatile storage device if flushed immediately, then flushing the data buffer to the non-volatile storage device;
if the rate of incoming data is higher than the rate of flushing data from the data buffer to the non-volatile storage device if flushed immediately, then waiting to receive another transaction; and
updating a flush performance history after each flush of the data buffer to the non-volatile storage device.
1 Assignment
0 Petitions
Accused Products
Abstract
In a transaction system, a dynamic batching process enables efficient flushing of data in a data buffer to a stable storage device. The transaction system uses constant values and dynamic values and a system performance history to adjust the rate of flushing data and also to adjust the amount of data flushed in each flush operation. The transaction system is able to respond to both spikes in rate of received transactions as well as more gradual changes in the rate of received transactions and to automatically adapt to stable storage device performance variations.
37 Citations
20 Claims
-
1. A method for efficiently batching transactions in a computerized system, comprising the steps of:
-
receiving a transaction at the computerized system; writing the received transaction data to a data buffer; if the received transaction is an only transaction in the computerized system, then flushing the data buffer to a non-volatile storage device; if the received transaction is not the only transaction in the computerized system, then determining whether a maximum response time will be met for an oldest transaction waiting for flush in the computerized system if the data buffer were flushed to the storage device immediately; if the maximum response time will not be met, then flushing the data buffer to the non-volatile storage device; if the maximum response time will be met, then determining whether a rate of data of incoming transactions is higher than a rate of flushing data from the data buffer to the non-volatile storage device if flushed immediately; if the rate of data of incoming transactions is lower than the rate of flushing data from the data buffer to the non-volatile storage device if flushed immediately, then flushing the data buffer to the non-volatile storage device; if the rate of incoming data is higher than the rate of flushing data from the data buffer to the non-volatile storage device if flushed immediately, then waiting to receive another transaction; and updating a flush performance history after each flush of the data buffer to the non-volatile storage device. - View Dependent Claims (2, 3, 4, 5, 6, 7)
-
-
8. A method for efficiently batching transactions in a database system, comprising the steps of:
-
receiving a transaction at the database system; writing the received transaction data to a data buffer; if the received transaction is an only transaction in the computerized system, then flushing the data buffer to a database; if the received transaction is not the only transaction in the computerized system, then determining whether a maximum response time will be met for an oldest transaction waiting for flush in the computerized system if the data buffer were flushed to the database immediately; if the maximum response time will not be met, then flushing the data buffer to the database; if the maximum response time will be met, then determining whether a rate of data of incoming transactions is higher than a rate of flushing data from the data buffer to the database if flushed immediately; if the rate of data of incoming transactions is lower than the rate of flushing data from the data buffer to the database if flushed immediately, then flushing the data buffer to the database; if the rate of incoming data is higher than the rate of flushing data from the data buffer to the database if flushed immediately, then waiting to receive another transaction; and updating a flush performance history after each flush of the data buffer to the database.
-
-
9. A transaction system that efficiently batches transactions, comprising:
-
a data interface to receive transactions; a non-volatile storage device to store processed transactions; a memory including a data buffer and a system performance history, the system performance history including system performance data about rates of flushing the data buffer to the non-volatile storage device and batch sizes of flushing the data buffer to the non-volatile storage device; and a controller coupled to the interface, the non-volatile storage device and the memory, the controller configured to process the transactions, to write the processed transactions to the data buffer, to flush the data buffer to the non-volatile storage device according to the system performance data from the system performance history, and to update the system performance history with data from the flush of the data buffer to the non-volatile storage device. - View Dependent Claims (10, 11, 12, 13, 14, 15, 16, 17)
-
-
18. A database system that efficiently batches transactions, comprising:
-
a data interface to receive database transactions; a non-volatile storage device having a database to store processed database transactions; a memory including a data buffer and a system performance history, the system performance history including system performance data about rates of flushing the data buffer to the database and batch sizes of flushing the data buffer to the database; and a controller coupled to the interface, the non-volatile storage device and the memory, the controller configured to process the transactions, to write the processed transactions to the data buffer, to flush the data buffer to the database according to the system performance data from the system performance history, and to update the system performance history with data from the flush of the data buffer to the database.
-
-
19. A computer program product having a computer-readable medium including computer program logic encoded thereon that, when performed on a computer system directs the computer system to perform the method of:
-
receiving a transaction at the computerized system; writing the received transaction data to a data buffer; if the received transaction is an only transaction in the computerized system, then flushing the data buffer to a non-volatile storage device; if the received transaction is not the only transaction in the computerized system, then determining, in the computerized system, whether a maximum response time will be met for an oldest transaction waiting for flush in the computerized system if the data buffer were flushed to the non-volatile storage device immediately; if the maximum response time will not be met, then flushing the data buffer to the non-volatile storage device; if the maximum response time will be met, then determining, in the computerized system, whether a rate of data of incoming transactions is higher than a rate of flushing data from the data buffer to the non-volatile storage device if flushed immediately; if the rate of data of incoming transactions is lower than the rate of flushing data from the data buffer to the non-volatile storage device if flushed immediately, then flushing the data buffer to the non-volatile storage device; if the rate of incoming data is higher than the rate of flushing data from the data buffer to the non-volatile storage device if flushed immediately, then waiting to receive another transaction; and updating a flush performance history in the computerized system after each flush of the data buffer to the non-volatile storage device.
-
-
20. A system for efficiently batching transactions in a computerized system, comprising:
-
means for receiving a transaction at the computerized system; means for writing the received transaction data to a data buffer; means for flushing the data buffer to a non-volatile storage device if the received transaction is an only transaction in the computerized system; means for determining whether a maximum response time will be met for an oldest transaction waiting for flush in the computerized system if the data buffer were flushed to the non-volatile storage device immediately if the received transaction is not the only transaction in the computerized system; means for flushing the data buffer to the non-volatile storage device if the maximum response time will not be met; means for determining whether a rate of data of incoming transactions is higher than a rate of flushing data from the data buffer to the non-volatile storage device if flushed immediately if the maximum response time will be met; means for flushing the data buffer to the non-volatile storage device if the rate of data of incoming transactions is lower than the rate of flushing data from the data buffer to the non-volatile storage device if flushed immediately; means for waiting to receive another transaction if the rate of incoming data is higher than the rate of flushing data from the data buffer to the non-volatile storage device if flushed immediately; and means for updating a flush performance history after each flush of the data buffer to the non-volatile storage device.
-
Specification