【nginx】如何解决使用nginx作为反向代理端口耗尽问题?

TCP 长连接负载均衡问题

(10W 用户) ----- TCP 长连接 ----- Nginx/HAproxy/LVS(软件负载) ------ TCP 长连接 ----- (实际业务,多台业务服务器)

客户端 TCP 10W 长连接到 Nginx/HAproxy 这一步,没有问题。

软件负载到实际业务这里,由于负载均衡(nginx) 是采用转发的方式进行处理的,本地会创建连接,当转发超出 65535 时,(nginx)就不能建立长连接了。

Linux 系统调优参数基本已经设置过了,应该不是这里的问题。

请问要进行哪些配置?

65535 那是 ipv4 协议本身的限制,问题是,nginx 到实际业务之间为什么要长连接?

处理过 50 万长连接的业务:nginx --> 实际业务服务器

在 nginx 这里采用多个内网 IP,这些 IP 使用 proxy_bind 来指定。

参考 https://nginx.org/r/proxy_bind

nginx 用 proxy_bind 这种方法最多能撑多少量级的长连接?

如何克服 nginx中的临时端口耗尽问题?

https://www.nginx.com/blog/overcoming-ephemeral-port-exhaustion-nginx-plus

nginx使用proxy_bind负载tcp socket,解决代理端口耗尽

https://www.sundayle.com/nginx-proxy-65535-port

高并发中负载均衡器临时端口耗尽问题

https://www.maideliang.com/index.php/archives/48

参考

一台Linux服务器最多能支撑多少个TCP连接?

https://blog.csdn.net/sqlquan/article/details/111561959

nginx 性能调优

Tuning NGINX for Performance

http://nginx.com/blog/tuning-nginx

https://www.cnblogs.com/clnchanpin/p/7026413.html

Ideal way to overcome port exhaustion/unix socket limit?

https://studygolang.com/resources/5916?fr=sidebar

使用 HAProxy 负载均衡300k并发tcp连接

https://www.sundayle.com/haproxy-optimization

Use HAProxy to load balance 300k concurrent tcp socket connections: Port Exhaustion, Keep-alive and others

https://www.linangran.com/?p=547

Nginx作为反向代理服务器是否可以突破单机65535TCP连接的限制?如果是,是如何实现的?

https://www.zhihu.com/question/306520501

Nginx 高级篇:单机并发 1 万 10 万次请求解决和优化方案

https://learnku.com/articles/42203

nginx 并发数问题思考:worker_connections,worker_processes与 max clients

https://blog.51cto.com/liuqunying/1420556

nginx tcp负载突破端口数量限制 proxy_bind split_client

https://www.codenong.com/cs105164127/

nginx代理websocket连接上限

https://blog.csdn.net/Wjhsmart/article/details/107385614

おすすめ

転載: blog.csdn.net/michaelwoshi/article/details/120170134
おすすめ