From 3bbad823e09c25ecb1758ed8a5c308cca13965cb Mon Sep 17 00:00:00 2001 From: Kerollmops Date: Tue, 28 Jan 2025 17:40:50 +0100 Subject: [PATCH] Refine the env variable and the max readers --- .../index-scheduler/src/index_mapper/index_map.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/crates/index-scheduler/src/index_mapper/index_map.rs b/crates/index-scheduler/src/index_mapper/index_map.rs index efc11d6a2..931cff162 100644 --- a/crates/index-scheduler/src/index_mapper/index_map.rs +++ b/crates/index-scheduler/src/index_mapper/index_map.rs @@ -1,6 +1,7 @@ use std::collections::BTreeMap; use std::env::VarError; use std::path::Path; +use std::str::FromStr; use std::time::Duration; use meilisearch_types::heed::{EnvClosingEvent, EnvFlags, EnvOpenOptions}; @@ -301,17 +302,15 @@ fn create_or_open_index( enable_mdb_writemap: bool, map_size: usize, ) -> Result { - use std::str::FromStr; - let mut options = EnvOpenOptions::new(); options.map_size(clamp_to_page_size(map_size)); - let max_readers = match std::env::var("MEILI_INDEX_MAX_READERS") { + let max_readers = match std::env::var("MEILI_EXPERIMENTAL_INDEX_MAX_READERS") { Ok(value) => u32::from_str(&value).unwrap(), - Err(VarError::NotPresent) => 100 * 1024, - Err(VarError::NotUnicode(value)) => { - panic!("Invalid unicode for the `MEILI_INDEX_MAX_READERS` env var: {value:?}") - } + Err(VarError::NotPresent) => 1024, + Err(VarError::NotUnicode(value)) => panic!( + "Invalid unicode for the `MEILI_EXPERIMENTAL_INDEX_MAX_READERS` env var: {value:?}" + ), }; options.max_readers(max_readers); if enable_mdb_writemap {