-
Notifications
You must be signed in to change notification settings - Fork 668
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
one indexer for multi-thread query cause blocked? #104
Comments
Hi @wenbotse, |
Hi @yurymalkov , I mean the python interface . multi threads use the same indexer.query it will be blocked |
QPS for multi-thread is much smaller than single-thread query |
@wenbotse It should not lock anything during the search - GIL is released. However, there is always a python-glue overhead that locks GIL before and after the search - it may lead to significant performance loss in multi-thread regime. It should not be a problem if single query takes more than 1ms though. |
@yurymalkov Thanks for your reply. In my application , the dim is 768, batch query is [70, 768]. It will cost 20~30ms when call query_knn / get_items(ids) (by python api with single thread) . Is it right ? but I didn't much cpu costs , although I use 'indexer.knn_query(his_items_vec, k=query_num, num_threads = 32)' |
@yurymalkov the blocked function should be get_items(ids) ? |
@wenbotse Yep, get_items does block the GIL, but it should be very fast. |
I supply a query service with http, which is a multi-thread application. I found when two thread query at the same time , query() function will be blocked , is there any solution solve this problem or walk around this .
The text was updated successfully, but these errors were encountered: