Skip to content

Commit 89b17ca

Browse files
committed
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 OpenUserJS#1548
1 parent b914392 commit 89b17ca

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

app.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ var privkey = require('./libs/debug').privkey;
1818
var fullchain = require('./libs/debug').fullchain;
1919
var chain = require('./libs/debug').chain;
2020

21+
var os = require('os');
22+
2123
//
2224
var path = require('path');
2325
var crypto = require('crypto');
@@ -66,14 +68,15 @@ var _ = require('underscore');
6668
var findSessionData = require('./libs/modifySessions').findSessionData;
6769

6870
var dbOptions = {};
71+
var defaultPoolSize = 5;
6972
if (isPro) {
7073
dbOptions = {
7174
secondaryAcceptableLatencyMS: 15,
72-
poolSize: 5
75+
poolSize: (isPro ? defaultPoolSize * os.cpus().length : defaultPoolSize)
7376
}
7477
} else {
7578
dbOptions = {
76-
poolSize: 5,
79+
poolSize: defaultPoolSize,
7780
reconnectTries: 30,
7881
reconnectInterval: 1000
7982
}

0 commit comments

Comments
 (0)