Skip to content

Commit

Permalink
fix: use global pool but not dedicated pool for every index (#37852)
Browse files Browse the repository at this point in the history
issue: #37851

- make a global thread pool at tantivy temporally.
- set 1 but not 4 threads for inverted text index.

Signed-off-by: chyezh <[email protected]>
  • Loading branch information
chyezh authored Nov 20, 2024
1 parent 7144219 commit f3a36f8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 20 deletions.
27 changes: 9 additions & 18 deletions internal/core/thirdparty/tantivy/tantivy-binding/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
tantivy = "=0.21.1"
tantivy = { git = "https://github.com/milvus-io/tantivy", tag = "0.21.1-fix" } # we have make a private fix for milvus, should be removed in future after milvus fixing the bug.
futures = "0.3.21"
libc = "0.2"
scopeguard = "1.2"
Expand Down
3 changes: 2 additions & 1 deletion internal/core/thirdparty/tantivy/tantivy-wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ using Map = std::map<std::string, std::string>;

static constexpr const char* DEFAULT_TOKENIZER_NAME = "milvus_tokenizer";
static const char* DEFAULT_analyzer_params = "{}";
static constexpr uintptr_t DEFAULT_NUM_THREADS = 4;
static constexpr uintptr_t DEFAULT_NUM_THREADS =
1; // Every field with index writer will generate a thread, make huge thread amount, wait for refactoring.
static constexpr uintptr_t DEFAULT_OVERALL_MEMORY_BUDGET_IN_BYTES =
DEFAULT_NUM_THREADS * 15 * 1024 * 1024;

Expand Down

0 comments on commit f3a36f8

Please sign in to comment.