2

We are using loopback-connector-mongodb@4.2.0 version to connect to mongo db . Our database admins are reporting that our application is using more connections and it is constantly growing. When they report issues , we just restart our applications and connection use count drops drastically (from 800 active connections to 500 connections on mongodb).

We need to implement connection pooling in loopback, but not sure on what settings needs to be done on the datasource.json file. Can you please give some suggestions.

thanks Arun S.

Sorin
  • 5,201
  • 2
  • 18
  • 45
Arun Cdw
  • 21
  • 1
  • can you show us some of your code? – Simas Joneliunas Jan 28 '20 at 04:53
  • 1
    looking at the documentation/source code there is no way to specify the poolSize in the datasource configuration - https://github.com/strongloop/loopback-connector-mongodb/blob/master/lib/mongodb.js You can try to set it via the connection URL (see: http://mongodb.github.io/node-mongodb-native/3.0/reference/connecting/connection-settings/) however the default value is 5 , which leads me to belive that there is another problem with your app. – Sorin Feb 02 '20 at 14:11

0 Answers0