File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed
frameworks/JavaScript/nodejs Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change 1
1
const cluster = require ( 'cluster' ) ;
2
- const physicalCpuCount = require ( 'physical-cpu-count' )
2
+ const numCPUs = require ( 'os' ) . cpus ( ) . length ;
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 < physicalCpuCount ; i ++ ) {
20
+ for ( let i = 0 ; i < numCPUs ; 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" ,
13
12
"parseurl" : " 1.3.2" ,
14
13
"pg" : " 8.5.0" ,
15
14
"pg-hstore" : " 2.3.2" ,
16
- "physical-cpu-count " : " ^2.0.0 " ,
17
- "sequelize " : " 5.15 .1"
15
+ "sequelize " : " 5.15.1 " ,
16
+ "node-cache " : " 4.1 .1"
18
17
},
19
18
"main" : " app.js"
20
19
}
You can’t perform that action at this time.
0 commit comments