Skip to content

Commit

Permalink
Increase poolSize depending on expected pro static thread count
Browse files Browse the repository at this point in the history
* 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 OpenUserJS#1548
  • Loading branch information
Martii committed Dec 19, 2018
1 parent b914392 commit 89b17ca
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 89b17ca

Please sign in to comment.