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
main
Maysam Yabandeh 7 years ago committed by Facebook Github Bot
parent 35a4469bbf
commit 0999e9b79a
  1. 4
      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<size_t>(21);
// 8m entry, 64MB size
static const size_t DEF_COMMIT_CACHE_BITS = static_cast<size_t>(23);
const size_t COMMIT_CACHE_BITS;
const size_t COMMIT_CACHE_SIZE;
const CommitEntry64bFormat FORMAT;

Loading…
Cancel
Save