Created
October 17, 2018 16:40
-
-
Save tehsis/e8144e096932b0d270a413c6a8343497 to your computer and use it in GitHub Desktop.
Cluster setup for Auth0 Scalability Workshop @ NodeConf 2018
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const os = require('os') | |
const cluster = require('cluster') | |
if (cluster.isMaster) { | |
os.cpus().forEach((cpu) => { | |
const worker = cluster.fork() | |
console.log(`Forked worker: ${worker.id}`) | |
}) | |
} else { | |
require('./lib/server') | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment