From 89b17ca27ec1a386fbb38bf9171b21dd34066b3d Mon Sep 17 00:00:00 2001 From: Martii Date: Tue, 18 Dec 2018 19:29:59 -0700 Subject: [PATCH 1/3] Increase `poolSize` depending on expected pro static thread count * This didn't seem to help in a direct test on production but doing since it's the logical thing to do with our current process manager. NOTE(S): * We don't currently have clustering management in the project itself but may at some point in the future so this could eventually use some improvement. Trying to keep this simple at start for everyone. Applies to #1548 --- app.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app.js b/app.js index d9fb46a01..ead1b6234 100755 --- a/app.js +++ b/app.js @@ -18,6 +18,8 @@ var privkey = require('./libs/debug').privkey; var fullchain = require('./libs/debug').fullchain; var chain = require('./libs/debug').chain; +var os = require('os'); + // var path = require('path'); var crypto = require('crypto'); @@ -66,14 +68,15 @@ var _ = require('underscore'); var findSessionData = require('./libs/modifySessions').findSessionData; var dbOptions = {}; +var defaultPoolSize = 5; if (isPro) { dbOptions = { secondaryAcceptableLatencyMS: 15, - poolSize: 5 + poolSize: (isPro ? defaultPoolSize * os.cpus().length : defaultPoolSize) } } else { dbOptions = { - poolSize: 5, + poolSize: defaultPoolSize, reconnectTries: 30, reconnectInterval: 1000 } From 03e9dd33320bbc3081610471503943218a3592c0 Mon Sep 17 00:00:00 2001 From: Martii Date: Tue, 18 Dec 2018 19:34:39 -0700 Subject: [PATCH 2/3] Go back to the original multiplier * This value is per thread otherwise it would be huge in each thread. Durr. Applies to #1548 --- app.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app.js b/app.js index ead1b6234..9d04ca2cf 100755 --- a/app.js +++ b/app.js @@ -18,8 +18,6 @@ var privkey = require('./libs/debug').privkey; var fullchain = require('./libs/debug').fullchain; var chain = require('./libs/debug').chain; -var os = require('os'); - // var path = require('path'); var crypto = require('crypto'); @@ -72,7 +70,7 @@ var defaultPoolSize = 5; if (isPro) { dbOptions = { secondaryAcceptableLatencyMS: 15, - poolSize: (isPro ? defaultPoolSize * os.cpus().length : defaultPoolSize) + poolSize: defaultPoolSize * 2 } } else { dbOptions = { From a4509b0b4dccd7619ab766a2aa46ee96bc91c476 Mon Sep 17 00:00:00 2001 From: Martii Date: Tue, 18 Dec 2018 19:36:43 -0700 Subject: [PATCH 3/3] Try triple multiplier * Since commit notes said it didn't seem to help let's try tripling the multiplier Applies to #1548 --- app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.js b/app.js index 9d04ca2cf..9801b20e3 100755 --- a/app.js +++ b/app.js @@ -70,7 +70,7 @@ var defaultPoolSize = 5; if (isPro) { dbOptions = { secondaryAcceptableLatencyMS: 15, - poolSize: defaultPoolSize * 2 + poolSize: defaultPoolSize * 3 } } else { dbOptions = {