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
https://docs.tardis.dev/api/tardis-machine
Mozilla Public License 2.0
235 stars 46 forks source link

Create a parameter for number of workers in cluster mode #18

Open gusostow opened 1 year ago

zbanga commented 1 year ago
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. 
gusostow commented 1 year ago

My desire was to use fewer than my total CPUs

zbanga commented 1 year ago

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