File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
frameworks/JavaScript/nodejs Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change 1
1
const cluster = require ( 'cluster' ) ;
2
- const numCPUs = require ( 'os' ) . cpus ( ) . length ;
2
+ const physicalCpuCount = require ( 'physical-cpu-count' )
3
3
4
4
process . env . NODE_HANDLER = 'mysql-raw' ;
5
5
@@ -17,7 +17,7 @@ if (cluster.isPrimary) {
17
17
console . log ( `Primary ${ process . pid } is running` ) ;
18
18
19
19
// Fork workers.
20
- for ( let i = 0 ; i < numCPUs ; i ++ ) {
20
+ for ( let i = 0 ; i < physicalCpuCount ; i ++ ) {
21
21
cluster . fork ( ) ;
22
22
}
23
23
Original file line number Diff line number Diff line change 9
9
"mongoose" : " 5.7.5" ,
10
10
"mysql" : " 2.16.0" ,
11
11
"mysql2" : " 1.6.5" ,
12
+ "node-cache" : " 4.1.1" ,
12
13
"parseurl" : " 1.3.2" ,
13
14
"pg" : " 8.5.0" ,
14
15
"pg-hstore" : " 2.3.2" ,
15
- "sequelize " : " 5.15.1 " ,
16
- "node-cache " : " 4.1 .1"
16
+ "physical-cpu-count " : " ^2.0.0 " ,
17
+ "sequelize " : " 5.15 .1"
17
18
},
18
19
"main" : " app.js"
19
20
}
You can’t perform that action at this time.
0 commit comments