简体   繁体   English

Ngnix负载平衡不是像代理服务器一样吗?

[英]Isn't Ngnix load balancing like proxy server?

Mainly is there any difference between using nginx as load balancer for bunch of upstream servers. 主要是使用nginx作为上游服务器群的负载平衡器之间没有任何区别。 Or using small nodejs proxy server that acts like a proxy between bunch of servers and one public hosting. 或使用小型的nodejs代理服务器,其充当一堆服务器和一个公共主机之间的代理。

It may look obvious to you but to me nginx is very new. 这对您来说似乎很明显,但对我而言,nginx是非常新的。 And i barely know anything about it.. 而且我对此一无所知。

Also i guess my question is there any performance advantage for using nginx as proxy server that distribute load vs running your own node js code that acts a proxy between other requests. 另外,我想我的问题是,使用nginx作为分配负载的代理服务器与运行自己的在其他请求之间充当代理的节点js代码相比,在性能方面有什么优势。

In case of introducing +1 technology I'd say keep custom NodeJS proxy as short-term solution. 在介绍+1技术的情况下,我想保留自定义NodeJS代理作为短期解决方案。

Long-term solution is Nginx as reverse-proxy among array of backend makes a big sense by number technical and maintenance reasons. 长期解决方案是Nginx,因为后端阵列中的反向代理从数量和技术上都非常有意义。 An application rarely stays the same because you apply new features, replace legacy code and deploy new ones so the way is to use right tool for right task. 应用程序很少保持不变,因为您可以应用新功能,替换旧代码并部署新功能,因此方法是使用正确的工具完成正确的任务。 Nginx is proven and chosen by many heavy loaded applications over the web. Nginx已被网络上许多繁重的应用程序证明和选择。 The memory consumption and CPU utilisation is low and stable. 内存消耗和CPU利用率低且稳定。

Most of people use Nginx as reverse-proxy (the biggest reason to use Nginx by the way) rather than anything else because such powerful and featured it is. 大多数人将Nginx用作反向代理(这是使用Nginx的最大原因),而不是其他任何东西,因为它是如此强大且功能强大。

From request-response life cycle m Nginx keeps rotating between backend to send request again if a given backend is dead, so not even one request lost. 从请求响应生命周期开始,如果给定的后端已死,则Nginx会在后端之间循环旋转以再次发送请求,因此甚至没有一个请求丢失。

From maintenance point of view dynamic upstream (part of commercial installation) with Rest interface looks good enough. 从维护的角度来看,带有Rest接口的动态上游(商业安装的一部分)看起来足够好。 Even open source version is easy to roll out upstream update + graceful reload (HUP signal). 即使是开源版本,也很容易推出上游更新+优美的重载(HUP信号)。 Nginx also supports zero downtime binary upgrade (USR2+QUIT). Nginx还支持零停机二进制升级(USR2 + QUIT)。

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

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