mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-22 18:17:39 +08:00
use only half of the computer threads for the indexation by default
This commit is contained in:
parent
8d8fe8fd29
commit
a59f437ee3
1
Cargo.lock
generated
1
Cargo.lock
generated
@ -1631,6 +1631,7 @@ dependencies = [
|
|||||||
"milli",
|
"milli",
|
||||||
"mime",
|
"mime",
|
||||||
"mockall",
|
"mockall",
|
||||||
|
"num_cpus",
|
||||||
"obkv",
|
"obkv",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"oxidized-json-checker",
|
"oxidized-json-checker",
|
||||||
|
@ -53,6 +53,7 @@ meilisearch-tokenizer = { git = "https://github.com/meilisearch/tokenizer.git",
|
|||||||
memmap = "0.7.0"
|
memmap = "0.7.0"
|
||||||
milli = { git = "https://github.com/meilisearch/milli.git", tag = "v0.6.0" }
|
milli = { git = "https://github.com/meilisearch/milli.git", tag = "v0.6.0" }
|
||||||
mime = "0.3.16"
|
mime = "0.3.16"
|
||||||
|
num_cpus = "1.13.0"
|
||||||
once_cell = "1.5.2"
|
once_cell = "1.5.2"
|
||||||
oxidized-json-checker = "0.3.2"
|
oxidized-json-checker = "0.3.2"
|
||||||
parking_lot = "0.11.1"
|
parking_lot = "0.11.1"
|
||||||
|
@ -23,7 +23,7 @@ pub struct UpdateHandler {
|
|||||||
impl UpdateHandler {
|
impl UpdateHandler {
|
||||||
pub fn new(opt: &IndexerOpts) -> anyhow::Result<Self> {
|
pub fn new(opt: &IndexerOpts) -> anyhow::Result<Self> {
|
||||||
let thread_pool = rayon::ThreadPoolBuilder::new()
|
let thread_pool = rayon::ThreadPoolBuilder::new()
|
||||||
.num_threads(opt.indexing_jobs.unwrap_or(0))
|
.num_threads(opt.indexing_jobs.unwrap_or(num_cpus::get() / 2))
|
||||||
.build()?;
|
.build()?;
|
||||||
Ok(Self {
|
Ok(Self {
|
||||||
max_nb_chunks: opt.max_nb_chunks,
|
max_nb_chunks: opt.max_nb_chunks,
|
||||||
|
Loading…
Reference in New Issue
Block a user