Skip to content

Instantly share code, notes, and snippets.

@tehsis
Created October 17, 2018 16:40
Show Gist options
  • Save tehsis/e8144e096932b0d270a413c6a8343497 to your computer and use it in GitHub Desktop.
Save tehsis/e8144e096932b0d270a413c6a8343497 to your computer and use it in GitHub Desktop.
Cluster setup for Auth0 Scalability Workshop @ NodeConf 2018
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