I know very little about nodejs. All I know is, that it works upon a single thread model, which switches to multiple threads for I/O
tasks. So for example,
Request A ----> nodejs (Single Thread)
// Finds out that it the requires requires I/O operation
nodejs ----> underlying OS (Starts An Independent Thread)
// nodejs is free to serve more requests
Does this mean for 1000 concurrent requests
, there will be a request that will be handled after all 999
requests are handled? If yes, it seems to be an inefficient system! I would term apache
running php
to be better suited (in the above case). Apache with PHP keeps the ability to launch 1000
concurrent threads and thus no processing queue and zero wait time.
I might be missing an important concept here, but is it really the way nodejs
works?