-
Notifications
You must be signed in to change notification settings - Fork 0
Cluster
Ivaylo Ivanov edited this page Jan 19, 2016
·
5 revisions
Defined in Esrol-servers and implemented in Esrol-server-app
Node Cluster API is implemented as a component, so everything that you need to do is to enable it from config.json file.
app/config/config.json
"cluster": {
"enabled": true,
"cores": "auto"
},
"servers": {
"http": {
"enabled": false,
"port": 3333,
"methods": ["get", "put", "post", "delete"],
"webSockets": false
},
"tcp": {
"enabled": true,
"port": 3334,
"allowHalfOpen": false,
"pauseOnConnect": false
},
"udp": {
"type": "udp4",
"enabled": false,
"port": 3335
}
}If cores property has an auto value, require('os').cpus().length will be used. If you want, you can specify the number by putting an int value - 4 - for four cores. If you need more information about cluster, please refer to Node Cluster API