Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Capping IndexWriter Num thread #1033

Merged
merged 4 commits into from
May 6, 2021
Merged

Capping IndexWriter Num thread #1033

merged 4 commits into from
May 6, 2021

Conversation

evanxg852000
Copy link
Collaborator

Added small changes for capping index writer number of thread to a maximum of 8.

Issue Link

@evanxg852000 evanxg852000 requested a review from fulmicoton May 5, 2021 14:46
@@ -441,7 +442,7 @@ impl Index {
/// # Panics
/// If the heap size per thread is too small, panics.
pub fn writer(&self, overall_heap_size_in_bytes: usize) -> crate::Result<IndexWriter> {
let mut num_threads = num_cpus::get();
let mut num_threads = std::cmp::max(num_cpus::get(), MAX_NUM_THREAD);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you meant min i believe.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😱

@fulmicoton fulmicoton merged commit 8d51e9c into main May 6, 2021
@fulmicoton fulmicoton deleted the fix-issues-1032 branch May 6, 2021 11:44
This was referenced Feb 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants