Would a blocking web server get hung up to the sense it needs restarting, if many http clients send requests at most in parallel?

Viewed 22

I read there are web servers their behaviors are called blocking whereas Node.js's is said non-blocking. Would a blocking web server get hung up to the sense it needs restarting, if many http clients send requests at most in parallel? As a complement, I don't say that it needs restarting while it potentially works fine again after the flood of parallel requests have stopped. And I currently don't understand how request buffers and overflows work for web servers.

1 Answers

Although technically it could be possible to make a single-thread, single-process blocking server that can only handle 1 request at a time, it doesn't really practically make sense. Concurrency is kind of important.

The three main paradigms for parallelism (that I know of) are:

  • Multi-process/forking
  • Threading
  • Using an event loop/reactor pattern

Node falls in the third category, and also a bit in the second category depending on how you look at it.

Most languages can look at a socket and read from it, and immediately move on if there was nothing to read. Therefore most languages can have this non-blocking behavior.

Related