5 ms·
I would be interested in hearing how LinkedIn gets around Node.js issues .For example Isn't Node.js single threaded ? Would it not under-perform , say compar
by badmash69 15y ago
I would be interested in hearing how LinkedIn gets around Node.js issues .For example
Isn't Node.js single threaded ? Would it not under-perform , say compared to Erlang or Netty, in a multi-core CPU.
- cygwin98 15y agoNot a Node.js expert myself. But, maybe you can put a cluster of Node.js instances behind a load-balancer like Nginx?
- nplusone 15y agoYou can, but one reason nginx isn't used as much is that it does not fully support HTTP 1.1. 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.
- pornel 15y ago> does not fully support HTTP 1.1. As a result, for example, although it's possible, it's not trivial to proxy WebSocket connections 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.
- bnoordhuis 15y ago> Isn't Node.js single threaded ? 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]. [1] http://learnboost.github.com/cluster/ http://learnboost.github.com/cluster/
- reginaldo 15y ago> 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.