vert-x3 / vertx-service-discovery

Some tools one can use for doing microservices with Vert.x
Apache License 2.0
115 stars 67 forks source link

Record lookup very slow when a lot of records are published #144

Closed robertonav20 closed 3 years ago

robertonav20 commented 3 years ago

Version

Version: 3.9.3

Context

The production environment contain 3000 verticle approx. When i use the method getRecord/getRecords for to get the current status of a verticle result to much slow. The reason of this problem is because the methods get all data, stored in memory and then apply the filter function.

Steps to reproduce

  1. Create a instance of vertx
  2. Create a Service Discovery instance
  3. Deploy 2000/3000 verticles
  4. Try to measure getRecord/getRecords response time and compare with the response time of the same methods from a smaller enviroment (50 verticles deployed)

Extra

I suggest a more efficient store method which use a unique key passed by the user or record.getRegistration(), against UUID.randomUUID().toString(), because with UUID key the user cannot read the record instantly and the service discovery must to get all data and apply function filter after read all 2k-3k etc.....

JVM version : OpenJDK 1.8.191

tsegismont commented 3 years ago

@robertonav20 can you share a pull request?

robertonav20 commented 3 years ago

Hi @tsegismont, you can see the pr here https://github.com/vert-x3/vertx-service-discovery/pull/145