Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7512903
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T00:00:47+00:00 2026-05-30T00:00:47+00:00

I was running a concurrency test, and for brevity’s sake, defined a process for

  • 0

I was running a concurrency test, and for brevity’s sake, defined a process for each spoofed http request. It worked fine for up to 64 requests/processes, but folded on 65. I’m running Window 7 (64bit) on an I5 laptop, with 4GB of Ram.

Whilst running the test I had a Chrome open (with a handful of tabs), and I expect that the OS’ common system processes would also have some effect, but I know too little about node.js at the lowest level to understand where the problem lies.

For example, one article suggest it’s possible to run well over 8000 processes on a 2GB 64-bit Windows XP system:

http://blogs.technet.com/b/markrussinovich/archive/2009/07/08/3261309.aspx

But the 64 child process figure that I ran into was rather conspicuous.

Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T00:00:48+00:00Added an answer on May 30, 2026 at 12:00 am

    Well node is asynchronous, there’s no blocking, only by the current script and it can handle multiple connections perfectly, so that means on a high concurrency, it would use all of your CPU, but each process can only use one core, since Node is not threaded. So technically what is recommend to have is having as many processes as your cores, one core for each process. In that case, on a high concurrency the Node cluster would use all of the CPU. If you go more than that, you are wasting your RAM and putting extra work on your OS scheduler. Beside that each nodejs process have an startup time. So it is very expensive to create a nodejs process at run time.

    From Node.JS docs:

    These child Nodes are still whole new instances of V8. Assume at least
    30ms startup and 10mb memory for each new Node. That is, you cannot
    create many thousands of them.

    Conclusion the best thing to do is to fork just as the number of your CPU cores, which is:

    var cluster = require('cluster');
    var http = require('http');
    var numCPUs = require('os').cpus().length;
    
    if (cluster.isMaster) {
      // Fork workers.
      for (var i = 0; i < numCPUs; i++) {
        cluster.fork();
      }
    
      cluster.on('exit', function(worker) {
        console.log('worker ' + worker.process.pid + ' died');
        cluster.fork();
      });
    } else {
      // Worker processes have a http server.
      http.Server(function(req, res) {
        res.writeHead(200);
        res.end("hello world\n");
      }).listen(8000);
    }
    

    We actually have a production server, doing that, which can take about 1000 concurrency, and less than 10ms latency serving the hello world.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Running a rails site right now using SQLite3. About once every 500 requests or
Running a ServiceHost with a single contract is working fine like this: servicehost =
Running IIS5 (yes, really). I'd like to remove the eTag http header that IIS
I have the following code running, but I sometimes get some sort of concurrency
I've created an integration test to verify that a repository handles Concurrency correcly. If
I recently got a new dedicated MySQL machine. Now it's running fine, but sometimes
I'm new to concurrency in Java. I've used Junit to test some of my
I've never worked with Concurrency library before. public class QueueExecutor { static final int
I am running 30 scripts (PHP CLI) on Linux , each script are updating
I need to draw a graph of write accesses of two concurrently running threads.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.