diff --git a/src/bees-hash.cc b/src/bees-hash.cc index 5cc2cb1..05e6980 100644 --- a/src/bees-hash.cc +++ b/src/bees-hash.cc @@ -595,6 +595,9 @@ BeesHashTable::BeesHashTable(shared_ptr ctx, string filename, off_t m_flush_rate_limit(BEES_FLUSH_RATE), m_stats_file(m_ctx->home_fd(), "beesstats.txt") { + // Reduce disk thrashing at startup: one reader at a time + m_extent_lock_set.max_size(1); + // Sanity checks to protect the implementation from its weaknesses THROW_CHECK2(invalid_argument, BLOCK_SIZE_HASHTAB_BUCKET, BLOCK_SIZE_HASHTAB_EXTENT, (BLOCK_SIZE_HASHTAB_EXTENT % BLOCK_SIZE_HASHTAB_BUCKET) == 0);