Upgrade to Pro — share decks privately, control downloads, hide ads and more …

mastodonのnodeのはなし

geta6
April 26, 2017
2.9k

 mastodonのnodeのはなし

geta6

April 26, 2017
Tweet

Transcript

  1. const cluster = require('cluster'); const os = require('os'); if (cluster.isMaster)

    { const core = Math.max(os.cpus().length - 1, 1); for (let i = 0; i < core; i++) cluster.fork(); } else { // your code here }