简体   繁体   English

使用Node.js和Nginx进行长轮询请求的负载平衡

[英]Load Balancing Long polling requests with Node.js and Nginx

What is the best load balancing strategy and software I can use to support about 50 Million users each with Http Long Polling/Websockets requests (this is important). 什么是最佳的负载平衡策略和软件,我可以用来支持大约5000万用户(每个用户使用Http Long Polling / Websockets请求)(这很重要)。 I am trying out the Node.js + Nginx option right now, but I have also heard of Erlang. 我现在正在尝试使用Node.js + Nginx选项,但是我也听说过Erlang。 Is there a solution which has been proven to handle such load? 是否有一种已被证明可以处理这种负载的解决方案?

Update - I had a typo in there. 更新-我在那里有错字。 The concurrency is expected to be about 50 Million and not 500 Million. 并发性预计约为5000万,而不是5亿。

First, 500 million is 1.6 times the number of people in the US. 首先,5亿是美国人口的1.6倍。 This number is very high, perhaps even excessively high. 这个数字非常高,甚至可能过高。 If you really need to scale to that number, you need a strategy for getting more than a single machine on the job. 如果您确实需要扩展到该数量,则需要一种策略,使工作中的机器不止一台。 No machine by itself can really handle that. 没有机器本身可以真正解决这个问题。 The TCP socket buffers alone would easily break the Terabyte memory range, especially since you want to employ long polling. 单独使用TCP套接字缓冲区,很容易会破坏兆兆字节的内存范围,特别是因为您要使用长轮询。 I have a hunch that your request is higher than what Google is experiencing for standing connections. 我有一种直觉,就是您的要求高于Google的常备联系要求。

If you want to do it, no single technology will do it. 如果您想这样做,没有任何一项技术可以做到。 You need to employ several different subsystems and you need to think about how data is stored, how data is moved around and so on. 您需要使用几个不同的子系统,并且需要考虑如何存储数据,如何移动数据等等。 Given a sizeable cluster, I think Node.js or Erlang are really good choices as pieces of the puzzle. 给定一个庞大的集群,我认为Node.js或Erlang确实是个不错的选择。 But this won't address the question of storing data for 500 million users. 但这无法解决为5亿用户存储数据的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM