Questions tagged [node-cluster]

a Node.js module for multi-core network serving.

Cluster is a Node.js module for multi-core network serving.

https://nodejs.org/api/cluster.html

173 questions
0
votes
0 answers

Passing circular JSON to cluster in node

I would like to get a multi-process node, working with Sequelize. As you can't call Sequelize's sync method to get your orm ready multiple time at once (database locking), I decided to call the sync method on the master cluster. When that's done,…
Extaze
  • 1,117
  • 2
  • 10
  • 18
0
votes
0 answers

Express and Cluster node modules in the same app

I am creating an app that allows users to upload files in their browsers to a server. I started it by typing express in the folder of my project. With that express created all the folders and such. It created a bin folder containing a www file that…
0
votes
1 answer

Node cluster not spawning phantom instances in the proper worker

I'm using NodeJS with PhantomJS. My goal is to create 4x node instances with node cluster, each with 2 phantom children. And my code looks like this: cluster.js: var numCPUs = 4; if (cluster.isMaster) { for (var i = 0; i < numCPUs; i++) { …
Deepsy
  • 3,769
  • 7
  • 39
  • 71
-1
votes
0 answers

Node server blocking

I have two api , fast and slow . The fast api has simple response and slow has a loop which runs over 1 billion iteration . When i open the slow api simultaneous till 8 tabs (which keeps loading)and then open fast api , i get the response quickly…
Sibi
  • 19
  • 3
-1
votes
1 answer

In NodeJs, Why my last forked worker process handle request every time, Although 7 worker process remain ideal?

I want to use cluster module to run express server side by side using worker process. Here is my complete script. const express = require('express'); const cluster = require('cluster'); const os = require('os'); const totalCPUs =…
Faizanur Rahman
  • 474
  • 3
  • 12
-1
votes
1 answer

node worker for loop slow between first and second iteration

I have a method that contains a for loop, and I have the main process and child processes calling this method. 20404 create: 2022-01-14 05:44:10.073 20404 create: 2022-01-14 05:44:10.075 20404 create: 2022-01-14 05:44:10.077 20404 create: …
Carl.W
  • 1
  • 3
-1
votes
1 answer

What is the algorithm behind NodeJS cluster?

The head is fairly self explanatory :) Node supports process clustering (documentation). But in the documentation I failed to see what algorithm does it use to distribute work to workers. Is it round-robin? PM2 is using round robin afaik.
Rouz
  • 1,247
  • 2
  • 15
  • 37
-1
votes
1 answer

Using await in code for a child process will make only that child process or all the other child process for execution?

I am using await in code for one of my child processes. So when this is executed, will all others child processes halt their execution or will only this child process will halt? I am using cluster.fork and await in code is for my child processes.
user3103874
  • 98
  • 1
  • 8
1 2 3
11
12