milvus-io / milvus-sdk-java

Java SDK for Milvus.
https://milvus.io
Apache License 2.0
380 stars 153 forks source link

We encountered performance issues when using milvus-sdk-java version 2.4.2 to connect to milvus v2.4.5-gpu. #1002

Closed ahern88 closed 1 month ago

ahern88 commented 1 month ago

We’re running milvusdb/milvus:v2.4.5-gpu in Docker and created a collection with 10k entries. Using milvus-sdk-java 2.4.2, retrieving the top 10 results takes around 400ms per request, whereas with Milvus 1 it only takes 20ms. This performance gap is quite significant. Checking with Arthas, we found that the delay occurs at [433.356541ms] io.milvus.client.MilvusServiceClient:retry(). Could you help us identify the cause?

xiaofan-luan commented 1 month ago

retry happens on all every call, so this is not the problem for sure

I think you need to

  1. check if you using strong consistency, change to default consistency
  2. install monitor, and check server side latency meet your expection.
  3. change log level to debug and export log so we can investigate on that
ahern88 commented 1 month ago

retry happens on all every call, so this is not the problem for sure

I think you need to

  1. check if you using strong consistency, change to default consistency
  2. install monitor, and check server side latency meet your expection.
  3. change log level to debug and export log so we can investigate on that

Yes, I was using strong consistency. When I switched to withConsistencyLevel(ConsistencyLevelEnum.BOUNDED), each request took only 10ms. That seems to be the issue. Thanks for the support. I’ve closed the issue.