mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-02-22 02:25:32 +08:00
Make sure the BBQueue is at least 50 MiB
This commit is contained in:
parent
8a35cd1743
commit
14ee7aa84c
@ -81,10 +81,12 @@ where
|
|||||||
let finished_extraction = AtomicBool::new(false);
|
let finished_extraction = AtomicBool::new(false);
|
||||||
|
|
||||||
// We compute and remove the allocated BBQueues buffers capacity from the indexing memory.
|
// We compute and remove the allocated BBQueues buffers capacity from the indexing memory.
|
||||||
|
let minimum_capacity = 50 * 1024 * 1024 * pool.current_num_threads(); // 50 MiB
|
||||||
let (grenad_parameters, total_bbbuffer_capacity) = grenad_parameters.max_memory.map_or(
|
let (grenad_parameters, total_bbbuffer_capacity) = grenad_parameters.max_memory.map_or(
|
||||||
(grenad_parameters, 100 * 1024 * 1024 * pool.current_num_threads()), // 100 MiB by thread by default
|
(grenad_parameters, 2 * minimum_capacity), // 100 MiB by thread by default
|
||||||
|max_memory| {
|
|max_memory| {
|
||||||
let total_bbbuffer_capacity = max_memory / (100 / 2); // 2% of the indexing memory
|
// 2% of the indexing memory
|
||||||
|
let total_bbbuffer_capacity = (max_memory / 100 / 2).min(minimum_capacity);
|
||||||
let new_grenad_parameters = GrenadParameters {
|
let new_grenad_parameters = GrenadParameters {
|
||||||
max_memory: Some(max_memory - total_bbbuffer_capacity),
|
max_memory: Some(max_memory - total_bbbuffer_capacity),
|
||||||
..grenad_parameters
|
..grenad_parameters
|
||||||
|
Loading…
x
Reference in New Issue
Block a user