-2

In the case where I have an http request handler in node js which performs some heavy synchronous code, the event loop isn't free to poll for incoming requests. But these requests are not lost anywhere and they are stored in some buffer internally, until node is free to poll. When it polls it executes them one at a time anyway. So I'm a little bit confused why it is bad to perform heavy synchronous code in request handlers. Thanks.

Mister_L
  • 2,469
  • 6
  • 30
  • 64

1 Answers1

0

As far as incoming TCP connections go, there is a backlog limit, which by default is usually 511, but could be further limited by your OS. Any connections that arrive after this limit is reached are rejected.

mscdex
  • 104,356
  • 15
  • 192
  • 153