Node JS Doubt on it’s Threaded Model

Node JS claimed using single threaded model, asynchronous, easily handle thousand concurrent HTTP request with efficient memory consumptions.

But underlying not. It does create internal threads from the main event loop thread using select calls.

For *nix based it creates fixed size thread pool, 4 threads.

Having one doubt:
Don’t say networking IO, it does consumes singke thread to do async IO.
But how File IO, it should utilize thread pools or OS level thread or process to read/write buffer. When dealing with large file, say, thousand concurrent requests to read large file, will 4 threads need to queue in order to process all read large file requests, then how the Node JS performance can be.

Nevertheless, Node JS really suitable to implement lightweight things like socket IO for soft real time, communication apps, the “front end” of the back end system, like API Interface, which is blazing fast, non blocking.

But it is not suitable for heavy business calls, like expensive large file read/write, complex database transactions like money transfer from one bank accounts to another, or any other data extensive operations.

Author: fyhao

Jebsen & Jessen Comms Singapore INTI University College Bsc (Hon) of Computer Science, Coventry University