在生产服务器上运行debian(7.0)和nodejs(v0.10.x)集群的问题,在那里它不closures到客户端的TCP连接。
当达到连接限制时,会导致连接丢失。
使用ss -s工具,我可以监控一些连接在一段时间后closures,但有些则不是。
这里是我使用为了增加最大连接作为临时解决方法的sysctrlconfiguration更改:
net.ipv4.ip_local_port_range = 1024 65500 net.core.rmem_max = 33554432 net.core.wmem_max = 33554432 net.ipv4.tcp_rmem = 4096 16384 33554432 net.ipv4.tcp_wmem = 4096 16384 33554432 net.ipv4.tcp_mem = 786432 1048576 26777216 net.core.netdev_max_backlog = 2000
如何find瓶颈并解决问题?
问题在于https服务器不会从http服务器inheritance套接字超时逻辑。
从2013年4月份开始有一个补丁合并,但是仍然没有合并到稳定的0.10分支。
解决scheme:
https ,使用一些代理服务器(nginx); 0.10节点版本。