From 0999e9b79a8d6264874c1433e872438b50694c1a Mon Sep 17 00:00:00 2001 From: Maysam Yabandeh Date: Mon, 26 Mar 2018 19:41:58 -0700 Subject: [PATCH] WritePrepared Txn: Increase commit cache size to 2^23 Summary: Current commit cache size is 2^21. This was due to a type. With 2^23 commit entries we can have transactions as long as 64s without incurring the cost of having them evicted from the commit cache before their commit. Here is the math: 2^23 / 2 (one out of two seq numbers are for commit) / 2^16 TPS = 2^6 = 64s Closes https://github.com/facebook/rocksdb/pull/3657 Differential Revision: D7411211 Pulled By: maysamyabandeh fbshipit-source-id: e7cacf40579f3acf940643d8a1cfe5dd201caa35 --- utilities/transactions/write_prepared_txn_db.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utilities/transactions/write_prepared_txn_db.h b/utilities/transactions/write_prepared_txn_db.h index cb1eac1e9..5de30ab8f 100644 --- a/utilities/transactions/write_prepared_txn_db.h +++ b/utilities/transactions/write_prepared_txn_db.h @@ -391,8 +391,8 @@ class WritePreparedTxnDB : public PessimisticTransactionDB { // A heap of prepared transactions. Thread-safety is provided with // prepared_mutex_. PreparedHeap prepared_txns_; - // 2m entry, 16MB size - static const size_t DEF_COMMIT_CACHE_BITS = static_cast(21); + // 8m entry, 64MB size + static const size_t DEF_COMMIT_CACHE_BITS = static_cast(23); const size_t COMMIT_CACHE_BITS; const size_t COMMIT_CACHE_SIZE; const CommitEntry64bFormat FORMAT; -- GitLab