File tree Expand file tree Collapse file tree 5 files changed +6
-7
lines changed
frameworks/JavaScript/fastify Expand file tree Collapse file tree 5 files changed +6
-7
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
if ( cluster . isPrimary ) {
5
5
console . log ( `Primary ${ process . pid } is running` ) ;
6
6
7
7
// Fork workers.
8
- for ( let i = 0 ; i < physicalCpuCount ; i ++ ) {
8
+ for ( let i = 0 ; i < numCPUs ; i ++ ) {
9
9
cluster . fork ( ) ;
10
10
}
11
11
Original file line number Diff line number Diff line change 1
- FROM node:18.12.1-slim
1
+ FROM node:18.12.1-alpine
2
2
3
3
COPY ./ ./
4
4
Original file line number Diff line number Diff line change 1
- FROM node:18.12.1-slim
1
+ FROM node:18.12.1-alpine
2
2
3
3
COPY ./ ./
4
4
Original file line number Diff line number Diff line change 1
- FROM node:18.12.1-slim
1
+ FROM node:18.12.1-alpine
2
2
3
3
COPY ./ ./
4
4
Original file line number Diff line number Diff line change 11
11
"knex" : " 2.4.2" ,
12
12
"mongodb" : " 3.5.9" ,
13
13
"mysql2" : " 2.2.5" ,
14
- "pg" : " 8.5.1" ,
15
- "physical-cpu-count" : " ^2.0.0"
14
+ "pg" : " 8.5.1"
16
15
}
17
16
}
You can’t perform that action at this time.
0 commit comments