applay-utils 1.9.2 → 1.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/utils/mdb.js +6 -1
package/package.json
CHANGED
package/utils/mdb.js
CHANGED
|
@@ -69,7 +69,12 @@ var connect = (alias, url, callback, onError) => {
|
|
|
69
69
|
console.log('===============>>>>>>> NOVO POOL DE CONEXÃO MDB ', url, alias);
|
|
70
70
|
|
|
71
71
|
const separator = url.includes('?') ? '&' : '/?';
|
|
72
|
-
|
|
72
|
+
// maxIdleTimeMS baixo (30s) fazia o pool destruir e recriar as conexões
|
|
73
|
+
// mínimas (minPoolSize) a cada ~30s, 24h/dia, mesmo sem tráfego — gerando
|
|
74
|
+
// uma quantidade enorme de eventos NETWORK de conexão/handshake no log do
|
|
75
|
+
// mongod (centenas de MB/dia). 10 minutos mantém o benefício de conexões
|
|
76
|
+
// "quentes" sem esse churn constante.
|
|
77
|
+
const uriparams = `${separator}appName=${alias}&minPoolSize=2&maxPoolSize=10&maxIdleTimeMS=600000&serverSelectionTimeoutMS=5000`;
|
|
73
78
|
|
|
74
79
|
registerShutdownHandlersOnce();
|
|
75
80
|
|