#community-help

Multi-threading and Parallel Processing in Typesense

TLDR Sidharth asked about multi-threading in Typesense. Kishore Nallan explained that queries are already run on multiple threads, but multi-search queries run sequentially. Some parts of query processing are multi-threaded, but not all.

Powered by Struct AI

2

9
3mo
Solved
Join the chat
Jun 19, 2023 (3 months ago)
Sidharth
Photo of md5-051f535431ff484f44f165e9a0b696a5
Sidharth
08:46 AM
Hello Team,
Is there a feature for multi-threading in-order to improve the Typesense performance?
Also, how parallel processing will work in the case of multi-search query?
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
08:48 AM
Queries are already run on multiple threads. However multi-search queries are run sequentially because the parallelism is reserved for processing multiple multi_search queries at the same time.
08:49
Kishore Nallan
08:49 AM
As for performance, we have some improvements in the works which we are beta testing now for both filtering and faceting.
Sidharth
Photo of md5-051f535431ff484f44f165e9a0b696a5
Sidharth
08:52 AM
Is there a way to parallelise the multi-search queries?
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
08:53 AM
No
Sidharth
Photo of md5-051f535431ff484f44f165e9a0b696a5
Sidharth
08:54 AM
Understood, Thanks Kishore Nallan

1

谢渊
Photo of md5-7a5b648ca51447c30b96671596d58a2b
谢渊
09:12 AM
Kishore Nallan does 'Queries are already on run multiple theads' means that even for query like 'q=lionel messi', multi-thread operations will be apply on fetching posting-list, intersection, scoring and so on for boosting?
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
09:39 AM
Some parts of query processing is multi threaded but not all. But several independent search queries can and do run in-parallel on multiple threads. We have a thread pool that is sized based on the number of available CPU cores and all operations use the threads from the pool.
谢渊
Photo of md5-7a5b648ca51447c30b96671596d58a2b
谢渊
09:58 AM
thx

1