tardis-dev / tardis-machine

Locally runnable server with built-in data caching, providing both tick-level historical and consolidated real-time cryptocurrency market data via HTTP and WebSocket APIs

Home Page:https://docs.tardis.dev/api/tardis-machine

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Create a parameter for number of workers in cluster mode

gusostow opened this issue · comments

if (cluster.isMaster) {
  for (let i = 0; i < numCPUs; i++) {
    cluster.fork()
  }
  
  The number of workers in your cluster is bound by the amount of CPU your server/computer has. It's probably not wise to go beyond the CPU limit as I imagine its probably one thread per CPU. 

My desire was to use fewer than my total CPUs

You can edit the file to use less than the total amount if CPUs and pass it in as a parameter.