milvus-io / milvus

A cloud-native vector database, storage for next generation AI applications
https://milvus.io
Apache License 2.0
30.05k stars 2.88k forks source link

[Bug]: uncontrolled memory growth #16043

Closed chensanle closed 2 years ago

chensanle commented 2 years ago

Is there an existing issue for this?

Environment

- Milvus version: 1.1.1
- Deployment mode(standalone or cluster): standlone
- SDK version(e.g. pymilvus v2.0.0rc2): gosdk v1.1.1
- OS(Ubuntu or CentOS): centos
- CPU/Memory: 32C/64Gib
- GPU: none
- Others:

Current Behavior

When I continue to do query operations, the memory grows uncontrollably. dim: 768; index:ivf_pq; nlist: 4096; m:12; 1M rows image

Expected Behavior

No response

Steps To Reproduce

1. create colleciton, index
2. insert data
3. benchmark test
4. continue to do query operations, topK: 3000.

Anything else?

No response

yanliang567 commented 2 years ago

@yhmo could u please help on this issue?

/assign @yhmo /unassign

yhmo commented 2 years ago

There is a "cache_size" in the server_config.yaml, by default it is 4GB. That means the memory usage will be controled around 4GB. The cache strategy is "LRU", that means the cache will grow until it hit the 4GB limit. So, if the milvus memory usage is steadily keep around the "cache_size", than it is as-designed.

In your server_config.yaml, what value is assigned to the "cache_size"?

chensanle commented 2 years ago

There is a "cache_size" in the server_config.yaml, by default it is 4GB. That means the memory usage will be controled around 4GB. The cache strategy is "LRU", that means the cache will grow until it hit the 4GB limit. So, if the milvus memory usage is steadily keep around the "cache_size", than it is as-designed.

Thanks for your reply. I probably understand. the Milvus cache_size is set to 50Gib.

yhmo commented 2 years ago

768 dim, 1M rows, data size is less than 4GB. No need to set 50GB. 4 ~ 6 GB is enough.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Rotten issues close after 30d of inactivity. Reopen the issue with /reopen.