From 88e69f4302dc144b7338902da61d429842248a89 Mon Sep 17 00:00:00 2001 From: arriven <20084245+Arriven@users.noreply.github.com> Date: Sun, 2 Oct 2022 17:53:08 +0300 Subject: [PATCH] Increase max concurrent readers on indexes --- meilisearch-lib/src/index/dump.rs | 1 + meilisearch-lib/src/index/index.rs | 1 + meilisearch-lib/src/snapshot.rs | 1 + 3 files changed, 3 insertions(+) diff --git a/meilisearch-lib/src/index/dump.rs b/meilisearch-lib/src/index/dump.rs index 6a41fa7a0..9cc3c033f 100644 --- a/meilisearch-lib/src/index/dump.rs +++ b/meilisearch-lib/src/index/dump.rs @@ -105,6 +105,7 @@ impl Index { let mut options = EnvOpenOptions::new(); options.map_size(size); + options.max_readers(1024); let index = milli::Index::new(options, &dst_dir_path)?; let mut txn = index.write_txn()?; diff --git a/meilisearch-lib/src/index/index.rs b/meilisearch-lib/src/index/index.rs index 02425d0bf..3d6c47949 100644 --- a/meilisearch-lib/src/index/index.rs +++ b/meilisearch-lib/src/index/index.rs @@ -94,6 +94,7 @@ impl Index { create_dir_all(&path)?; let mut options = EnvOpenOptions::new(); options.map_size(size); + options.max_readers(1024); let inner = Arc::new(milli::Index::new(options, &path)?); Ok(Index { inner, diff --git a/meilisearch-lib/src/snapshot.rs b/meilisearch-lib/src/snapshot.rs index da4907939..4566a627e 100644 --- a/meilisearch-lib/src/snapshot.rs +++ b/meilisearch-lib/src/snapshot.rs @@ -181,6 +181,7 @@ impl SnapshotJob { let mut options = milli::heed::EnvOpenOptions::new(); options.map_size(self.index_size); + options.max_readers(1024); let index = milli::Index::new(options, entry.path())?; index.copy_to_path(dst, CompactionOption::Enabled)?; }