简体   繁体   English

有弹性的还是nginx的负载均衡websocket?

[英]Bouncy or nginx for load balancing websockets?

I want to add a load balancer infront of my nodejs websockets server. 我想在我的nodejs websockets服务器的前面添加一个负载均衡器。 The plan is to add another node on another physical machine and have a load balancer in front. 计划是在另一台物理计算机上添加另一个节点,并在前面有一个负载平衡器。 The load balancer will also be on its own physical machine. 负载平衡器也将位于其自己的物理计算机上。

The requirement is that several 1000s of simultaneous connections could be handled and I'm a bit worried about bouncys upper limitations. 要求是可以处理数千个同时连接,而我对弹性上限有一点担心。

I like the consistency of using bouncy since it is a node module, but at the same time it seems like nginx could handle more socket connections or be a bit more stable. 我喜欢使用Bouncy的一致性,因为它是一个节点模块,但是与此同时,nginx似乎可以处理更多的套接字连接,或者更加稳定。

Anyone who has experience with bouncy or nginx as load balancer and could give me some advices? 任何有弹性或nginx作为负载均衡器经验的人都可以给我一些建议吗?

Thanks! 谢谢!

nginx is pretty good for mass connections, check these answer. nginx非常适合进行大规模连接,请检查以下答案。

https://stackoverflow.com/a/16289251/2325522 https://stackoverflow.com/a/16289251/2325522

there you can see how to use Nginx as load balacer. 在那里,您可以看到如何使用Nginx作为负载平衡器。

The only problem that you can have is the mass band-width needed to serve 1000's of simultaneous connections. 您可能遇到的唯一问题是服务于1000个同时连接所需的大带宽。

Example: 例:

5000 clients * 0.25Mb/request (a little one)

= =

1250mb (1.25Gb outgoing band-width)

Hope these solve your doubts. 希望这些能解决您的疑问。

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

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