Isn't Node.js single threaded ? Would it not under-perform , say compared to Erlang or Netty, in a multi-core CPU.
Isn't Node.js single threaded ? Would it not under-perform , say compared to Erlang or Netty, in a multi-core CPU.
Yes (for now, we might take up V8 isolates).
> Would it not under-perform , say compared to Erlang or Netty, in a multi-core CPU.
No. You can spin up multiple processes and handle the load with (for example) cluster[1].
Which is what I speculate they're doing, as they say they're running just four instances. Probably, they have servers capable of running 4 threads at the same time.
As a result, for example, although it's possible, it's not trivial to proxy WebSocket connections, which are commonly used with node.js apps. Streaming uploads/downloads have similar challenges.
Non-sequitur. WebSocket protocol is not HTTP/1.1.
WebSocket does have HTTP-like handshake as a hack, but it does not give required behavior in spec-compliant HTTP/1.1 clients, e.g. RFC 2616 requires connection to be closed after Upgrade is sent. WebSockets needs it open. HTTP requires proxies seeing Connection:Upgrade to remove the Upgrade header. WebSocket clients require this header to be present.
So basically a fully HTTP/1.1 compliant proxy is unable to proxy WebSocket connections by design.
If you need only fast downstream communication, you can use Server-Sent Events though.