Skip to content
New issue

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

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

Already on GitHub? # to your account

[Bug]: Insert and index building are slow #40551

Open
1 task done
bigsheeper opened this issue Mar 11, 2025 · 2 comments
Open
1 task done

[Bug]: Insert and index building are slow #40551

bigsheeper opened this issue Mar 11, 2025 · 2 comments
Assignees
Labels
area/performance Performance issues kind/bug Issues or changes related a bug needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.

Comments

@bigsheeper
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Environment

- Milvus version:master&2.5&2.4
- Deployment mode(standalone or cluster):
- MQ type(rocksmq, pulsar or kafka):    
- SDK version(e.g. pymilvus v2.0.0rc2):
- OS(Ubuntu or CentOS): 
- CPU/Memory: 
- GPU: 
- Others:

Current Behavior

When the number of segments is high, some operations in DataCoord metadata hold locks for extended periods, leading to lock starvation and subsequently slowing down insertion and index building.

Image

Image

Expected Behavior

No response

Steps To Reproduce

Milvus Log

No response

Anything else?

No response

@bigsheeper bigsheeper added kind/bug Issues or changes related a bug needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Mar 11, 2025
@bigsheeper bigsheeper self-assigned this Mar 11, 2025
Copy link

dosubot bot commented Mar 11, 2025

I found a similar closed issue titled "[Bug]: [benchmark] slow insertion with low datanodes workload" [1]. However, no solution was found in the comments of that issue.

Regarding the current issue, the SetStoredIndexFileSizeMetric function in the Milvus codebase uses a read lock (RLock) to ensure thread-safe access to the indexMeta and collections data structures while calculating the stored index file size metric. This locking mechanism allows multiple readers to access the data concurrently but can lead to lock starvation if write operations are blocked for extended periods [2][3].

To address the issue of lock starvation, consider reviewing the operations that hold locks for extended periods and explore potential optimizations or restructuring to minimize lock contention. Additionally, examining the locking patterns and ensuring that locks are held for the shortest duration necessary can help mitigate the problem.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@bigsheeper
Copy link
Contributor Author

related to #37630

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
area/performance Performance issues kind/bug Issues or changes related a bug needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.
Projects
None yet
Development

No branches or pull requests

1 participant