-
Notifications
You must be signed in to change notification settings - Fork 83
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
Fallback to Set Thread Num by Cgroups when Users Did Not Do So #188
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: PwzXxm The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
The easiest way is simply passed in from golang? |
as a library, I think it make sense to receive a params of concurrency? |
Yes, if you run Milvus + Knowhere, Milvus will use a hook to pass it to Knowhere. This PR fixs when Knowhere is running alone, e.g., VectorDBBench now supports benchmark Knowhere/Cardinal alone and we encountered this issue. |
Right. This PR will not change this logic. Use the Milvus passed params first; if not received anything, fallback to read from cgroups; fails to read from cgroups, fallback to system thread num. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM overall but need more comments to explain how it works so the code reader don't need to google.
Why we cannot simply call the init method to set the number from lib caller side? |
This requires an additional pyknowhere interface and a manual setup every time. Then the question is, should Knowhere use ALL of the CPUs BY DEFAULT even if it was limited to a smaller number of them? Or should Knowhere care about the environment at all when the user didn't set any value? |
Signed-off-by: Patrick Weizhi Xu <[email protected]>
Just to confirm. What is going to happen if I run under |
|
issue: #187
/kind enhancement
Read system cgroups to find out the CPU quota and period to get the correct limited CPU num under the K8s environment when running Knowhere alone, i.e., without Milvus.
For instance, if an instance has 64 CPUs, k8s limits it to 16c,
If it fails to read from groups, fallback
hardware_concurrency()
.For systems other than Linux, fallback as well.
Support cgroups V1 only for now. Maybe support V2 later.