mongo-jdbc-driver icon indicating copy to clipboard operation
mongo-jdbc-driver copied to clipboard

Test connection too slow

Open trangiaminh opened this issue 3 years ago • 8 comments

I'm using the newest Datagrip with the newest Mongo driver v1.12. But it's too slow when test connection / open a connection to query, it took great than 17s :( And it's the same when execute a simple query (find with limit 10 item) on a collection >10s :(

I checked Mongo driver other versions and summary in here (test connection - query time):

  • v1.12: >17s - >10s
  • v1.8 - v1.11: >5s - >2s
  • <=v1.73: >2s - >2s

Could you @kornilova203 please check this issue and give me some advices?

trangiaminh avatar Oct 11 '21 16:10 trangiaminh

@trangiaminh, yes, unfortunately you are right

https://github.com/mongodb-js/mongosh for some reason now runs very slow in Java driver. I'll investigate the issue

kornilova203 avatar Oct 11 '21 17:10 kornilova203

@kornilova203 I hope the good news day by day :)

I don't understand yet about https://github.com/mongodb-js/mongosh? It uses Mongo java driver to interact with MongoDB, right?

trangiaminh avatar Oct 15 '21 15:10 trangiaminh

@trangiaminh, it's a bit more complicated. This JDBC driver uses Java mongosh. Java Mongosh uses Mongo java driver under the hood and knows how to interpret MongoDB commands written in JavaScript like db.collection.find({}). Mongo java driver itself cannot run MongoDB commands that are written in JavaScript.

kornilova203 avatar Oct 20 '21 09:10 kornilova203

@kornilova203 Currently, only you develop Mongo Driver for DataGrip?

trangiaminh avatar Oct 20 '21 14:10 trangiaminh

@trangiaminh, yes

kornilova203 avatar Oct 21 '21 11:10 kornilova203

@trangiaminh you can also follow an issue https://youtrack.jetbrains.com/issue/DBE-14376 to track progress

tjlee avatar Dec 16 '21 09:12 tjlee

Any update on this issue? The latest driver (v1.13) still lags on the initial connection. (takes more than 20s)

leejh3224 avatar Feb 17 '22 15:02 leejh3224

At the moment we're investigating this issue. Stay tuned!

tjlee avatar Mar 21 '22 09:03 tjlee

I made some optimizations a while ago:

the very first connection will take ~6 seconds but all the subsequent connections should be almost instant.

https://youtrack.jetbrains.com/issue/DBE-14376/Slow-initial-MongoDB-connection#focus=Comments-27-6129076.0-0

I'll close this issue as obsolete

kornilova203 avatar Dec 18 '23 11:12 kornilova203