Skip to content

Commit 75b5ebf

Browse files
authored
Revert "Fix use the physical CPU count from NodeJS (#7985)" (#8043)
This reverts commit 1847278.
1 parent 59cf159 commit 75b5ebf

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

frameworks/JavaScript/nodejs/app.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const cluster = require('cluster');
2-
const physicalCpuCount = require('physical-cpu-count')
2+
const numCPUs = require('os').cpus().length;
33

44
process.env.NODE_HANDLER = 'mysql-raw';
55

@@ -17,7 +17,7 @@ if (cluster.isPrimary) {
1717
console.log(`Primary ${process.pid} is running`);
1818

1919
// Fork workers.
20-
for (let i = 0; i < physicalCpuCount; i++) {
20+
for (let i = 0; i < numCPUs; i++) {
2121
cluster.fork();
2222
}
2323

frameworks/JavaScript/nodejs/package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,11 @@
99
"mongoose": "5.7.5",
1010
"mysql": "2.16.0",
1111
"mysql2": "1.6.5",
12-
"node-cache": "4.1.1",
1312
"parseurl": "1.3.2",
1413
"pg": "8.5.0",
1514
"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"
1817
},
1918
"main": "app.js"
2019
}

0 commit comments

Comments
 (0)