mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-22 21:04:27 +01:00
Attempt to use default budget for faster startup
This commit is contained in:
parent
6ca7a109b9
commit
0202ff8ab4
@ -435,9 +435,19 @@ impl IndexScheduler {
|
|||||||
mut task_db_size: usize,
|
mut task_db_size: usize,
|
||||||
max_index_count: usize,
|
max_index_count: usize,
|
||||||
) -> IndexBudget {
|
) -> IndexBudget {
|
||||||
let budget = utils::dichotomic_search(base_map_size, |map_size| {
|
#[cfg(windows)]
|
||||||
Self::is_good_heed(tasks_path, map_size)
|
const DEFAULT_BUDGET: usize = 6 * 1024 * 1024 * 1024 * 1024; // 6 TiB, 1 index
|
||||||
});
|
#[cfg(not(windows))]
|
||||||
|
const DEFAULT_BUDGET: usize = 80 * 1024 * 1024 * 1024 * 1024; // 80 TiB, 18 indexes
|
||||||
|
|
||||||
|
let budget = if Self::is_good_heed(tasks_path, DEFAULT_BUDGET) {
|
||||||
|
DEFAULT_BUDGET
|
||||||
|
} else {
|
||||||
|
log::debug!("determining budget with dichotomic search");
|
||||||
|
utils::dichotomic_search(DEFAULT_BUDGET / 2, |map_size| {
|
||||||
|
Self::is_good_heed(tasks_path, map_size)
|
||||||
|
})
|
||||||
|
};
|
||||||
|
|
||||||
log::debug!("memmap budget: {budget}B");
|
log::debug!("memmap budget: {budget}B");
|
||||||
let mut budget = budget / 2;
|
let mut budget = budget / 2;
|
||||||
|
Loading…
Reference in New Issue
Block a user